Closed GA-MEB closed 8 years ago
var Person = Ember.Object.extend({ fullName: Ember.computed('givenName', 'surname', function(){ return this.get('givenName') + ' ' + this.get('surname'); }), isOverFifty: Ember.computed.gte('age', 50), isABelcher: Ember.computed.equal('surname', 'Belcher'), hasNickname: Ember.computed.notEmpty('nickname'), kidsWithLongerNames: Ember.computed.filter('kids.@each.name', function(kid){ return kid.get('name').length > 4; }) }); var gene = Ember.Object.create({ name: 'Gene', age: 9 }); var tina = Ember.Object.create({ name: 'Tina', age: 14 }); var louise = Ember.Object.create({ name: 'Louise', age: 7 }) var bob = Person.create({ givenName: 'Bob', surname: 'Belcher', age: 45, kids: [gene, tina, louise] })