Function

propertyNames
String
func
Function
returns
func

Specify a method that observes property changes.

1
2
3
4
5
6
7
8
import EmberObject from '@ember/object';
import { observer } from '@ember/object';

export default EmberObject.extend({
  valueObserver: observer('value', function() {
    // Executes whenever the "value" property changes
  })
});

Also available as Function.prototype.observes if prototype extensions are enabled.