Skip to Content
Full Stack Development with JHipster
book

Full Stack Development with JHipster

by Deepu K Sasidharan, Sendil Kumar N
March 2018
Intermediate to advanced content levelIntermediate to advanced
380 pages
9h 23m
English
Packt Publishing
Content preview from Full Stack Development with JHipster

Angular route for the entity

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: 'product/:id',        component: ProductDetailComponent,        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. The 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. Routes having a popup, declares the outlet: 'popup' attribute.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Full Stack Development with JHipster - Second Edition

Full Stack Development with JHipster - Second Edition

Deepu K Sasidharan, Sendil Kumar Nellaiyapen
Jasmine Cookbook

Jasmine Cookbook

Munish Kumar

Publisher Resources

ISBN: 9781788476317Supplemental Content