Ember.computed.deprecatingAlias()

deprecatingAlias (dependentKey, options) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/computed_macros.js:619 Available since 1.7.0 Creates a new property that is an alias for another property on an object. Calls to get or set this property behave as though they were called on the original property, but also print a deprecation warning. let Hamster = Ember.Object.extend({ bananaCount: Ember.computed.deprecatingAlias('cavendishCount', { id: 'hamster.deprec

Ember.computed.collect()

collect (dependentKey) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/reduce_computed_macros.js:541 A computed property that returns the array of values for the provided dependent properties. Example let Hamster = Ember.Object.extend({ clothes: Ember.computed.collect('hat', 'shirt') }); let hamster = Hamster.create(); hamster.get('clothes'); // [null, null] hamster.set('hat', 'Camp Hat'); hamster.set('shirt', 'Camp Shirt'); hamster.get('clothes'); // ['Camp

Ember.computed.bool()

bool (dependentKey) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/computed_macros.js:183 A computed property that converts the provided dependent property into a boolean value. let Hamster = Ember.Object.extend({ hasBananas: Ember.computed.bool('numBananas') }); let hamster = Hamster.create(); hamster.get('hasBananas'); // false hamster.set('numBananas', 0); hamster.get('hasBananas'); // false hamster.set('numBananas', 1); hamster.get('hasBananas'); // true

Ember.computed.and()

and (dependentKey) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/computed_macros.js:423 A computed property that performs a logical and on the original values for the provided dependent properties. You may pass in more than two properties and even use property brace expansion. The computed property will return the first falsy value or last truthy value just like JavaScript's && operator. Example let Hamster = Ember.Object.extend({ readyForCamp: Ember.

Ember.computed.alias()

alias (dependentKey) Ember.ComputedPropertypublic Defined in packages/ember-runtime/lib/computed/computed_macros.js:503 Creates a new property that is an alias for another property on an object. Calls to get or set this property behave as though they were called on the original property. let Person = Ember.Object.extend({ name: 'Alex Matchneer', nomen: Ember.computed.alias('name') }); let alex = Person.create(); alex.get('nomen'); // 'Alex Matchneer' alex.get('name'); // 'Alex Matchn

Ember.computed

Ember.computed Namespace PUBLIC Defined in: packages/ember-metal/lib/computed.js:452 Module: ember-metal This helper returns a new property descriptor that wraps the passed computed property function. You can use this helper to define properties with mixins or via Ember.defineProperty(). If you pass a function as an argument, it will be used as a getter. A computed property defined in this way might look like this: let Person = Ember.Object.extend({ init() { this._super(...arguments)

Ember.compare()

compare (v, w) Numberpublic Defined in packages/ember-runtime/lib/compare.js:40 Compares two javascript values and returns: -1 if the first is smaller than the second, 0 if both are equal, 1 if the first is greater than the second. Ember.compare('hello', 'hello'); // 0 Ember.compare('abc', 'dfg'); // -1 Ember.compare(2, 1); // 1 If the types of the two objects are different precedence occurs in the following order, with types earlier in the list considered < types

Ember.changeProperties()

changeProperties (callback, binding) private Defined in packages/ember-metal/lib/property_events.js:226 Make a series of property changes together in an exception-safe way. Ember.changeProperties(function() { obj1.set('foo', mayBlowUpWhenSet); obj2.set('bar', baz); }); Parameters: callback Function binding []

Ember.canInvoke()

canInvoke (obj, methodName) Booleanprivate Defined in packages/ember-metal/lib/utils.js:316 Checks to see if the methodName exists on the obj. let foo = { bar: function() { return 'bar'; }, baz: null }; Ember.canInvoke(foo, 'bar'); // true Ember.canInvoke(foo, 'baz'); // false Ember.canInvoke(foo, 'bat'); // false Parameters: obj Object The object to check for the method methodName String The method name to check for Returns: Boolean

Ember.cacheFor()

cacheFor (obj, key) Objectpublic Defined in packages/ember-metal/lib/computed.js:554 Returns the cached value for a property, if one exists. This can be useful for peeking at the value of a computed property that is generated lazily, without accidentally causing it to be created. Parameters: obj Object the object whose property you want to check key String the name of the property whose cached value you want to return Returns: Object the cached value