2014-11-14 115 views

回答

0

如果你想重新呈现取决于控制器的性能视图,在模板中只是约束它

{{#view "myView" foo=controllerProperty}} 
    {{propertyThatDependsOnFoo}} 
{{/view}} 


App.MyView = Ember.View.extend({ 
    foo: null, // initialized in template 
    ... 
    propertyThatDependsOnFoo: function() { 
     ... 
    }.property("foo") 
}); 

然后在你的控制器只是改变controllerProperty,自动这将在您的视图中反映出来。

+0

是否应该如下? {{#view“myView”fooBinding = controllerProperty}} {{view.propertyThatDependsOnFoo}} {{/ view}}' – undeletable

相关问题