Why does console.log data.markets give me an empty array [] for markets while after initialization of the JSON request I do get the complete array?
@refresh = (data) ->
$table = @select('table')
$table.prepend(JST['market'](market)) for market in data.markets
console.log data.markets
The console.log markets is showing the data. What I am missing that the markets array is not passed over to @refresh?
@after 'initialize', ->
$.getJSON "/api/v2/tickers", (data) ->
markets = []
for own cur of data
ticker = data[cur].ticker
item = {}
item.volume = ticker.vol
markets.push item
console.log markets
@.refresh {markets: markets}
Complete code here: http://pastebin.com/wXXC7utT