控制器看起来像这样
class App.ContactsController extends Tower.Controller
index: (params) ->
@set('person', App.HighrisePerson.create())
@render "index"
视图看起来像这样
App.ContactsEditView = Ember.View.extend
templateName: 'contacts/edit'
resourceBinding: 'controller.person'
init: (args...) ->
@._super(args...)
console.log(@.get('resource'))
console.log('inited')
使用上面的块,我在控制台中看到资源设置为我的 Ember.Object 的一个实例
但使用以下视图代码
div class: "row-fluid", ->
text "{{#with resource}}"
text "Hello"
text "{{/with}}"
父视图的相关部分
div class: "row-fluid contact-form", ->
div class: "row-fluid", ->
h1 "Want to work with us?"
p "So...you want to be kohactivated!?!? Please take a few moments to fill out the form below and provide us with some details about your project, company or start-up."
text "{{view App.ContactsEditView}}"
我没有看到 hello 的渲染输出
如果我将你好移到#with 块之外,我会看到你好,
所以我认为由于某种原因它没有识别资源
任何帮助表示赞赏。