Push operations on an array not being observed


#1

I might be missing something very basic here, but push operations on an instance of Ember.Array() are not getting observed at all:

[JSBin] [Release] - http://emberjs.jsbin.com/kaqigiqoce/1/edit?html,js,console,output

[JSBin] [Beta] - http://emberjs.jsbin.com/navizemolu/1/edit?html,js,console,output

[JSBin] [Canary] - http://emberjs.jsbin.com/wacikereda/1/edit

Can someone explain what’s wrong here?


#2

push is not observed because javascript, you have to use addObject.


#3

@varblob Oh, my bad. Thanks for the link.


#4

Correction it should be pushObject

Sorry about that!


#5

So addObject is an extension of pushObject which additionally checks if the object is already present in the array. Got it.