Reputation: 19443
In the template like this
{{#if cond}}
a
{{else}}
b
{{/if}}
is it possible in if
helper in handlebars template to access properties that were defined in view?
App.QqqqView = Ember.View.extend({
templateName: "qqqq",
cond: true
});
Demo http://emberjs.jsbin.com/aZOguFIK/1/edit?html,js,output
Seems like it doesn't work, but I'm not sure why.
Upvotes: 0
Views: 33
Reputation: 17522
You need to tell it to look in the view.
{{#if view.cond}}
a
{{else}}
b
{{/if}}
http://emberjs.jsbin.com/aZOguFIK/2/edit
Upvotes: 1