Closed apsylone closed 11 years ago
hi there.. I like the idea. I dont like your use of eval. there must be an alternative and faster way to do that.
Couldn't you just use [] notation and remove the eval altogether?
if (data[rootNode] === undefined) {
// error code...
} else {
data = data[rootNode];
}
If it's of any use, I've just come up against the same issue. How I solved it was by adding an option called "container" (although something like "root" is better), then added the following (at line 226):
if(typeof model.config.container == 'string') {
data = data[model.config.container];
}
Is this maybe too simplistic?
ping @viezel ! Any news on this pull request ? :)
Hi guys,
I just pushed an update for the adapter. I ended up doing this: https://github.com/viezel/napp.alloy.adapter.restapi/blob/master/restapi.js#L278 In this implementation is it possible to use a nested root node. Have a look at the docs, and tell me what you think :)
I think it would be useful (in my case it was) to permits to add a "rootNode" parameter. It permits to have a JSON with extras informations like "total", "limit" eg. in the root node and have another level for models data.