Answers for "resolver in angular"

-1

resolver in angular

content_copy
      
      @Injectable({ providedIn: 'root' })
export class HeroResolver implements Resolve<Hero> {
  constructor(private service: HeroService) {}

  resolve(
    route: ActivatedRouteSnapshot,
    state: RouterStateSnapshot
  ): Observable<any>|Promise<any>|any {
    return this.service.getHero(route.paramMap.get('id'));
  }
}
Posted by: Guest on September-03-2020

Code answers related to "resolver in angular"

Code answers related to "Javascript"

Browse Popular Code Answers by Language