If i want to modify this find with findById({}).
findById({})
How to modify in loopback +angular 2 SDk?
.find({offset: 0, limit: 100 }) .subscribe(function(response: any) { });
If you are using findById({}) then there is no need for further filters like offset and limit, as findById({}) return one single object based on the id
offset
limit
id
User.findById({ id: your_id, filter:{ include:{ relation: 'roles' } } })
This is an example of retrieving a User object with the roles relation.
User
roles
Note: The syntax is based on Angular 1, haven't tried on Angular 2
If you are using
findById({})
then there is no need for further filters likeoffset
andlimit
, asfindById({})
return one single object based on theid
This is an example of retrieving a
User
object with theroles
relation.Note: The syntax is based on Angular 1, haven't tried on Angular 2