javascript - How to have both observer and on init for ember js properties -
new ember rules states need use below pattern
propobserver: ember.observer(function () { //code })
instead of
propobserver: function() { //code }.observers('someprop')
before updating ember below
propobserver: function () { //code }.observes('someprop').on('init')
how achieve cascading?
now know can separately
propobserver: ember.observer('someprop', function () { //code }) propobserver: ember.on('init', function () { //code })
from 2.0.0 docs: http://guides.emberjs.com/v2.0.0/object-model/observers/#toc_observers-and-object-initialization
propobserver: ember.on('init', ember.observer('someprop', function() { // code }))
Comments
Post a Comment