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

Find with no arguments #380

Open djvs opened 8 years ago

djvs commented 8 years ago

I want to do a $find() with no arguments - the server is only going to return one record to begin with. I'm a little new to the library and find myself writing .mix.. $extend.. Scope..$find, but don't know how to fill in the $find method (if it's appropriate to use a $super or not), or if there's a better way to do this. The docs are a little ambiguous on custom methods. Can anyone help with this?

waleedasif322 commented 8 years ago

Just do a $find(1) bruh

utf4 commented 8 years ago

You cannot use $find without any parameter, $find is mapped to GET call of REST API. REST GET call need id of a single record and returns that specific record. It is little late but if you still are wondering answer of this question.