0
votes

So I have a loopback API set with a relation between two models. I am currently using Angular 6 for the FrontEnd. I have a "Product" model alongside a "Brand" model with a relation set up in loopback. The relation foreignKey is set to "brId" where the product has a relation of "belongsTo" and the Brand being "hasMany." The "brId" tag is stored as a number.

I currently am using dist build of the angular app stored inside the client folder of my loopback directory.

the question is how can I use the relation set in loopback to filter queries in angular? Basically, is there an easier way for me to utilize the relation in loopback to filter products when I click on the brand page?

Thanks.

1
Which loopback version are you having at API ? Please mention. - Samarpan

1 Answers

0
votes

While calling your API you may send your filters like

apiurl/brandId?filters={filters}