Function#observes()

observespublic

Defined in packages/ember-runtime/lib/ext/function.js:81

The observes extension of Javascript's Function prototype is available when EmberENV.EXTEND_PROTOTYPES or EmberENV.EXTEND_PROTOTYPES.Function is true, which is the default.

You can observe property changes simply by adding the observes call to the end of your method declarations in classes that you write. For example:

Ember.Object.extend({
  valueObserver: function() {
    // Executes whenever the "value" property changes
  }.observes('value')
});

In the future this method may become asynchronous.

See Ember.observer.

doc_EmberJs
2016-11-30 16:52:08
Comments
Leave a Comment

Please login to continue.