【发布时间】:2012-08-03 18:51:08
【问题描述】:
我有以下容器
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 字段绑定到视图?它是未定义的。这是否与父视图中的“出口”有关?
此示例Binding child views and collections within an outlet in emberjs 展示了如何将任意对象绑定到视图。
【问题讨论】:
标签: ember.js