Last active
August 19, 2018 14:49
-
-
Save RayLuxembourg/b755332bf1534e138111e8d842989254 to your computer and use it in GitHub Desktop.
ProductResolver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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