Observable#incrementProperty()

incrementProperty (keyName, increment) Numberpublic Defined in packages/ember-runtime/lib/mixins/observable.js:433 Set the value of a property to the current value plus some amount. person.incrementProperty('age'); team.incrementProperty('score', 2); Parameters: keyName String The name of the property to increment increment Number The amount to increment by. Defaults to 1 Returns: Number The new property value

Observable#propertyDidChange()

propertyDidChange (keyName) Ember.Observableprivate Defined in packages/ember-runtime/lib/mixins/observable.js:294 Notify the observer system that a property has just changed. Sometimes you need to change a value directly or indirectly without actually calling get() or set() on it. In this case, you can use this method and propertyWillChange() instead. Calling these two methods together will notify all observers that the property has potentially changed value. Note that you must always call

Observable#notifyPropertyChange()

notifyPropertyChange (keyName) Ember.Observablepublic Defined in packages/ember-runtime/lib/mixins/observable.js:318 Convenience method to call propertyWillChange and propertyDidChange in succession. Parameters: keyName String The property key to be notified about. Returns: Ember.Observable

Observable#propertyWillChange()

propertyWillChange (keyName) Ember.Observableprivate Defined in packages/ember-runtime/lib/mixins/observable.js:270 Notify the observer system that a property is about to change. Sometimes you need to change a value directly or indirectly without actually calling get() or set() on it. In this case, you can use this method and propertyDidChange() instead. Calling these two methods together will notify all observers that the property has potentially changed value. Note that you must always ca

Observable#get()

get (keyName) Objectpublic Defined in packages/ember-runtime/lib/mixins/observable.js:100 Retrieves the value of a property from the object. This method is usually similar to using object[keyName] or object.keyName, however it supports both computed properties and the unknownProperty handler. Because get unifies the syntax for accessing all these kinds of properties, it can make many refactorings easier, such as replacing a simple property with a computed property, or vice versa. Computed P

Observable#getWithDefault()

getWithDefault (keyName, defaultValue) Objectpublic Defined in packages/ember-runtime/lib/mixins/observable.js:415 Retrieves the value of a property, or a default value in the case that the property returns undefined. person.getWithDefault('lastName', 'Doe'); Parameters: keyName String The name of the property to retrieve defaultValue Object The value to return if the property value is undefined Returns: Object The property value or the defaultValue.

Observable#getProperties()

getProperties (list) Objectpublic Defined in packages/ember-runtime/lib/mixins/observable.js:143 To get the values of multiple properties at once, call getProperties with a list of strings or an array: record.getProperties('firstName', 'lastName', 'zipCode'); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } is equivalent to: record.getProperties(['firstName', 'lastName', 'zipCode']); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } Parameters: list String...|Array

Observable#hasObserverFor()

hasObserverFor (key) Booleanprivate Defined in packages/ember-runtime/lib/mixins/observable.js:400 Returns true if the object currently has observers registered for a particular key. You can use this method to potentially defer performing an expensive action until someone begins observing a particular property on the object. Parameters: key String Key to check Returns: Boolean

Observable#endPropertyChanges()

endPropertyChangesEmber.Observableprivate Defined in packages/ember-runtime/lib/mixins/observable.js:251 Ends a grouping of property changes. You can use this method to group property changes so that notifications will not be sent until the changes are finished. If you plan to make a large number of changes to an object at one time, you should call beginPropertyChanges() at the beginning of the changes to defer change notifications. When you are done making changes, call this method to deli

Observable#cacheFor()

cacheFor (keyName) Objectpublic Defined in packages/ember-runtime/lib/mixins/observable.js:490 Returns the cached value of a computed property, if it exists. This allows you to inspect the value of a computed property without accidentally invoking it if it is intended to be generated lazily. Parameters: keyName String Returns: Object The cached value of the computed property, if any