Your template is not updated because you use plain vanilla javascript .push instead of ember provided .pushObject and .removeObject respectively. Ember extends the prototype of the array by default so that it plays well in a binding-enabled environment.
So, in order to update your template, you must do:
App.MaintemplateController = Ember.Controller.extend({ alist: ['foo', "bar"], actions : { addel: function(){ this.get('alist').pushObject('xpto'); console.log(this.get('alist')); } } });
The important line here is this.get('alist').pushObject('xpto'); In addition, you should always use .get() and .set() to access objects in ember, otherwise the binding mechanism will not be aware of changes made to the object.
Hope this helps.
source share