Skip to content

Instantly share code, notes, and snippets.

@RayLuxembourg
Last active August 19, 2018 14:49
Show Gist options
  • Save RayLuxembourg/b755332bf1534e138111e8d842989254 to your computer and use it in GitHub Desktop.
Save RayLuxembourg/b755332bf1534e138111e8d842989254 to your computer and use it in GitHub Desktop.
ProductResolver
@Injectable()
export class ProductResolver implements Resolve<Product> {
constructor(private api: ApiService) {}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Product> {
return this.api.product(route.params['id']);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment