didDefineProperty (proto, key, value)
This Ember.js hook allows an object to be notified when a property is defined.
In this case, we use it to be notified when an Ember Data user defines a belongs-to relationship. In that case, we need to set up observers for each one, allowing us to track relationship changes and automatically reflect changes in the inverse has-many array.
This hook passes the class being set up, as well as the key and value being defined. So, for example, when the user does this:
DS.Model.extend({ parent: DS.belongsTo('user') });
This hook would be called with "parent" as the key and the computed property returned by DS.belongsTo
as the value.
Parameters:
-
proto
Object
-
key
String
-
value
Ember.ComputedProperty
Please login to continue.