ember.js - Ember.beforeOberver callback is asynchronous to property change -


context: http://emberjs.jsbin.com/diyirecu/23/edit

is there anyway have ember.beforeoberver callback run first , property changes? or should using different strategy together?

not sure if can turn event synchronous... however, refactored code use simple jquery patterns (callbacks... know, non-ember of me) achieve same thing. code clunky compared looking achieve, works.

example jsbin: http://emberjs.jsbin.com/diyirecu/26/edit

i changed popobject removeobject removed item clicked on.

app.indexcontroller = ember.objectcontroller.extend({   content: {},   colors: ['red','blue','green'],   color: 'orange',    actions: {     addcolor: function () {       var color = this.get('color'),           $ul = ember.$('ul');        if (color) {         $ul.fadeout(500, function () {           this.get('colors').pushobject(color);           this.set('color', '');           $ul.fadein();         }.bind(this));       }     },     removecolor: function (color) {       var $ul = ember.$('ul');       $ul.fadeout(500, function () {         this.get('colors').removeobject(color); //changed popobject         $ul.fadein();       }.bind(this));     }   }, }); 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

jquery - Keeping Kendo Datepicker in min/max range -