lundi 31 août 2015

How to have both observer and on init for ember js properties

New ember rules states that we need to use the below pattern

propObserver: Ember.observer(function () {
   //code
})

instead of

propObserver: function() {
    //code
}.observers('someProp')

Before updating ember we could do the below

propObserver: function () {
    //code
}.observes('someProp').on('init')

How to achieve this cascading?

Now i know we can do this separately

propObserver: Ember.observer('someProp', function () {
   //code
})

propObserver: Ember.on('init', function () {
       //code
})




Aucun commentaire:

Enregistrer un commentaire