- I do have multiple pages, each page has different API calls. then do I need to create different resolvers for each page?
- can I implement resolve to the main service without adding new service?
I wrote resole service like this
resolve(route: ActivatedRouteSnapshot, rstate: RouterStateSnapshot): Observable <any>{
return this.http.get(''+this.webAPI+'getproducts', {
headers: {
"Authorization": "Token " + this.token,
},
withCredentials: true
}
);
}
inside my constructor is
this.actr.data.map(data => data.cres ).subscribe((response) =>{
console.log("reas", response)
})