Ember.computed.lte()

lte (dependentKey, value) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/computed_macros.js:389 A computed property that returns true if the provided dependent property is less than or equal to the provided value. Example let Hamster = Ember.Object.extend({ needsMoreBananas: Ember.computed.lte('numBananas', 3) }); let hamster = Hamster.create(); hamster.get('needsMoreBananas'); // true hamster.set('numBananas', 5); hamster.get('needsMoreBananas'); // false h

Ember.computed.mapBy()

mapBy (dependentKey, propertyKey) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/reduce_computed_macros.js:208 Returns an array mapped to the specified key. let Person = Ember.Object.extend({ childAges: Ember.computed.mapBy('children', 'age') }); let lordByron = Person.create({ children: [] }); lordByron.get('childAges'); // [] lordByron.get('children').pushObject({ name: 'Augusta Ada Byron', age: 7 }); lordByron.get('childAges'); // [7] lordByron.get('child

Ember.computed.intersect()

intersect (propertyKey) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/reduce_computed_macros.js:438 A computed property which returns a new array with all the duplicated elements from two or more dependent arrays. Example let obj = Ember.Object.extend({ friendsInCommon: Ember.computed.intersect('adaFriends', 'charlesFriends') }).create({ adaFriends: ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'], charlesFriends: ['William King', '

Ember.computed.gte()

gte (dependentKey, value) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/computed_macros.js:321 A computed property that returns true if the provided dependent property is greater than or equal to the provided value. Example let Hamster = Ember.Object.extend({ hasTooManyBananas: Ember.computed.gte('numBananas', 10) }); let hamster = Hamster.create(); hamster.get('hasTooManyBananas'); // false hamster.set('numBananas', 3); hamster.get('hasTooManyBananas'); //

Ember.computed.lt()

lt (dependentKey, value) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/computed_macros.js:355 A computed property that returns true if the provided dependent property is less than the provided value. Example let Hamster = Ember.Object.extend({ needsMoreBananas: Ember.computed.lt('numBananas', 3) }); let hamster = Hamster.create(); hamster.get('needsMoreBananas'); // true hamster.set('numBananas', 3); hamster.get('needsMoreBananas'); // false hamster.set('nu

Ember.computed.gt()

gt (dependentKey, value) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/computed_macros.js:287 A computed property that returns true if the provided dependent property is greater than the provided value. Example let Hamster = Ember.Object.extend({ hasTooManyBananas: Ember.computed.gt('numBananas', 10) }); let hamster = Hamster.create(); hamster.get('hasTooManyBananas'); // false hamster.set('numBananas', 3); hamster.get('hasTooManyBananas'); // false hamster

Ember.computed.filter()

filter (dependentKey, callback) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/reduce_computed_macros.js:248 Filters the array by the callback. The callback method you provide should have the following signature. item is the current item in the iteration. index is the integer index of the current item in the iteration. array is the dependant array itself. function(item, index, array); let Hamster = Ember.Object.extend({ remainingChores: Ember.computed.filter(

Ember.computed.filterBy()

filterBy (dependentKey, propertyKey, value) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/reduce_computed_macros.js:291 Filters the array by the property and value let Hamster = Ember.Object.extend({ remainingChores: Ember.computed.filterBy('chores', 'done', false) }); let hamster = Hamster.create({ chores: [ { name: 'cook', done: true }, { name: 'clean', done: true }, { name: 'write more unit tests', done: false } ] }); hamster.get('remaini

Ember.computed.equal()

equal (dependentKey, value) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/computed_macros.js:253 A computed property that returns true if the provided dependent property is equal to the given value. Example let Hamster = Ember.Object.extend({ napTime: Ember.computed.equal('state', 'sleepy') }); let hamster = Hamster.create(); hamster.get('napTime'); // false hamster.set('state', 'sleepy'); hamster.get('napTime'); // true hamster.set('state', 'hungry'); hams

Ember.computed.empty()

empty (dependentKey) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/computed_macros.js:53 Available since 1.6.0 A computed property that returns true if the value of the dependent property is null, an empty string, empty array, or empty function. Example let ToDoList = Ember.Object.extend({ isDone: Ember.computed.empty('todos') }); let todoList = ToDoList.create({ todos: ['Unit Test', 'Documentation', 'Release'] }); todoList.get('isDone'); // false todoLis