samedi 11 avril 2015

Ember.observer run on init

I'm attempting to build an Ember app without prototype extensions and the Ember docs give examples of how to do this, but they don't include the example of when I want my observer to run on init. So currently if my code were written like this:



fullNameChanged: function() {
// deal with the change
}.observes('fullName').on('init')


The only example I can find to write it is like this:



Person.reopen({
fullNameChanged: Ember.observer('fullName', function() {
// deal with the change
})
});


So how would I tell this code to run on init?





Aucun commentaire:

Enregistrer un commentaire