January 2020
Intermediate to advanced
428 pages
10h 34m
English
We need a route declaration so that we can access the entity pages. This is declared in product.route.ts.
For example, this declares the detail view of the entity:
{ path: ':id/view', component: ProductDetailComponent, resolve: { product: ProductResolve }, data: { authorities: ['ROLE_USER'], pageTitle: 'storeApp.product.home.title' }, canActivate: [UserRouteAccessService] },
The data attribute is used to pass metadata, such as allowed roles and page titles, to the component. UserRouteAccessService, defined in the canActivate attribute, decides whether a user has the authorization to view the page and uses the authorities' metadata and authentication details to verify the user's authorization. ProductResolve ...
Read now
Unlock full access