应用程序控制器
isHotel_profile: function (){
return this.get('currentPath') === 'hotel';
}.property('currentPath'),
成分</ P>
{{#step-controller hotelPage=isHotel_profile}} {{/step-controller}}
这是组件模板
{{#if hotelPage}}
hotel page
{{else}}
not hotel page
{{/if}}
我想将该属性用作条件,我该如何实现
答案 0 :(得分:2)
您的代码有效且应该可以正常使用。
这是一个演示:http://emberjs.jsbin.com/nesete/1/edit?html,js,output
请注意,您可以像这样简化计算属性:
isHotel_profile: Ember.computed.equal('currentPath', 'hotel')