Pla*_*Ton 3 javascript coffeescript backbone.js
我有一个骨干路由器
@collection = new Backbonedemo.Collections.Posts()
@flashes = new Backbone.Collection.Flashes()
Run Code Online (Sandbox Code Playgroud)
在它的initialize方法.
在路由器的new方法中,有这样的:
new: ->
view = new Backbonedemo.Views.PostsNew(collection: @collection, flashes: @flashes)
$('#posts_container').html(view.render().el)
Run Code Online (Sandbox Code Playgroud)
该@collection变量将在就好了,但是render(),console.log @flashes回报undefined.
那么,我错过了什么?
| 归档时间: |
|
| 查看次数: |
1041 次 |
| 最近记录: |