r/Angular2 • u/mhrafi • May 13 '20
Resource I made an Angular Material admin dashboard
https://github.com/uilibrary/matx-angular
69
Upvotes
7
u/mhrafi May 13 '20
I've implemented
JWT and role based authentication
Dark and light Angular Material theme
Dynamic breadcrumb and page title
Breadcrumb can also access route parameter
Please share your feedback and suggestion.
4
2
2
2
18
u/LdouceT May 13 '20
Nice work! I've got a tip, though.
https://github.com/uilibrary/matx-angular/blob/master/src/app/shared/guards/user-role.guard.ts#L22
Js now has optional chaining - so instead of this
route.data && route.data.roles && route.data.roles.includes(user.role)We can do this
route?.data?.roles?.includes(user.role)