1

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

Cœur
  • 37,241
  • 25
  • 195
  • 267
chris_1a3
  • 61
  • 4

1 Answers1

2

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')
Andrey Mikhaylov - lolmaus
  • 23,107
  • 6
  • 84
  • 133