我有以下容器
script type: 'text/x-handlebars', 'data-template-name': 'application', ->
text '''
{{outlet}}
'''
然后这个视图连接到它
script type: 'text/x-handlebars', 'data-template-name': 'index', ->
text '''
{{view App.SignUpView}}
'''
实际视图
App.SignUpView = Ember.View.extend
templateName: 'signup'
isValid: true
email: ''
password: ''
模板:
script type: 'text/x-handlebars', 'data-template-name': 'signup', ->
text '''
is valid: {{isValid}}
'''
如何将 isValid 字段绑定到视图?它是未定义的。这是否与父视图中的“出口”有关?
这个在 emberjs 的插座中绑定子视图和集合的示例展示了如何将任意对象绑定到视图。