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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -