Quang Van
Quang Van

Reputation: 12095

How to use Derby.js model arrays?

I keep getting Fatal error: [object Object] is not an Array and then a server crash, whenever I try to use Derby.js/Racer's model array methods, (push, insert) for example.

app.ready (model)->
   model.set 'list', []
   model.push 'list', 'test'

Upvotes: 0

Views: 300

Answers (1)

Quang Van
Quang Van

Reputation: 12095

https://github.com/codeparty/racer/issues/71

The root model has to an object. So the below would work.

app.ready (model)->
    model.set 'list.list', []
    model.push 'list.list', 'test'

Upvotes: 1

Related Questions