I have a controller object that\'s like:
MyApp.objController = Ember.ArrayController.create({
init: function(data) {
data.isValid = function() {
retu
If you define your isValid
as a property
, you can use it in your if
statement without creating a custom Handlebars helper, see http://jsfiddle.net/pangratz666/Dq6ZY/:
Handlebars:
JavaScript:
App.MyObj = Ember.Object.extend({
isValid: function() {
return this.get('age') >= 18;
}.property('age')
});
Ember.View.create({
templateName: 'obj-template',
controller: App.MyObj.create({
age: 21
})
}).append();