【发布时间】:2012-10-21 17:56:14
【问题描述】:
我有一个骨干路由器有
@collection = new Backbonedemo.Collections.Posts()
@flashes = new Backbone.Collection.Flashes()
在其initialize 方法中。
在路由器的new方法中,有这样的:
new: ->
view = new Backbonedemo.Views.PostsNew(collection: @collection, flashes: @flashes)
$('#posts_container').html(view.render().el)
@collection 变量传入就好了,但在render() 中,console.log @flashes 返回undefined。
那么,我错过了什么?
【问题讨论】:
标签: javascript backbone.js coffeescript