platanus / angular-restmod

Rails inspired REST-API ORM for Angular
http://platanus.github.io/angular-restmod/
MIT License
1.18k stars 87 forks source link

Search not returns Instances. Returns Json Objects #385

Open joseglego opened 8 years ago

joseglego commented 8 years ago

I was working with this lib. And following the example in the documentation. I'm doing:

Bike.$search({ brand: 'Trek' })

The return is ok, a list with all possible bikes with the brand. But, what happen now If I wanna modify each element of the list and update it?. The return is just a list of Json Objects. But I think it must return a List of instances of Bikes instances.

I think the $save() can evaluate if the Instance have an Id and do an UPDATE or if have not id do a POST. Or the list must be a list of Bikes instances.

jpulec commented 8 years ago

The result of Bike.$search({brand: 'Trek'}) should be a restmod Collection. A Collection contains individual instances of Bike. What does more of your code look like?