Reputation: 59
application controller
isHotel_profile: function (){
return this.get('currentPath') === 'hotel';
}.property('currentPath'),
component
{{#step-controller hotelPage=isHotel_profile}} {{/step-controller}}
and here's the component template
{{#if hotelPage}}
hotel page
{{else}}
not hotel page
{{/if}}
i want to use the property as conditional how can i achieve that
Upvotes: 1
Views: 621
Reputation: 23873
Your code is valid and should work fine.
Here's a demo: http://emberjs.jsbin.com/nesete/1/edit?html,js,output
Note that you can simplify your computed property like this:
isHotel_profile: Ember.computed.equal('currentPath', 'hotel')
Upvotes: 2