I’m pretty new with Ember and I’ve got his error since I tried to display some data from an ajax call :
Uncaught TypeError: Object #<Object> has no method 'addArrayObserver'
The app is very simple, but I wanted to send an ajax request to my server when I was going on a specific page. So I could load the data directly from the server…
model: function () {
return ajax('url', options);
}
The result of ajax is a promise that gets resolved by the route. I recommend that you use Ember Data, because it’s a big pain trying to create your own ORM, and basically you’re just trying to create ED anyways.
Thank you, but I tried to figured it out to do it with ember data but since I have a lot of data coming back from my server I thought that could be easier to do it directly from the request…
Most likely I receive this :
Object {ok: true, enquiries: Array[3]}
enquiries: Array[3]
0: Object
1: Object
2: Object
And in every Object I’ve got around 30 to 40 fields…
I’m gonna try your fix !
[Edit] :
I still got the same error as I had before plus an other one…
Assertion failed: The value that #each loops over must be an Array. You passed [object Object] (wrapped in (generated enquiries controller))
Uncaught TypeError: Object [object Object] has no method 'addArrayObserver'