Im workiing with Angular 8, Ionic 4 and trying to reduce server calls by caching
I have a search service that returns an Observable.
I want to know if I can use the router to access functions in that service.
For example: in routes something like {path: 'api/:func/:term', component: ApiComponent }
then in a page I would make a request to hit the api route like: http.get('/api/search-cars/corvette') would route to a searchCars(term:string) function and take corvette as the argument. This is a filter function, returning a portion of the array that is in the RXJS store.
The purpose of this would be to be able to cache that request url so the server isn't hit everytime data is sorted.
When I try to hook something up I get a 404 error. Is there a way to create an internal API?