i tried but getting error message and it says "Value of type 'typeof
AuthGuard' is not callable. Did you mean to include 'new'?"
Acutally, It was given by role. See
*In auth.service:*this.currentRole = localStorage.getItem("role");
On Friday, September 15, 2017 at 3:13:22 PM UTC+5, Sander Elias wrote:
>
> Hi Adnan,
>
> If you have just 2 roles, I would create a separate auth guard for those.
> If it's more, you can use a closure to keep the role in the guard.
> { path: 'child1', component: UserVehicleDetailsComponent, canActivate: [
> AuthGuard('admin')] }, //Admin
> { path: 'child1', component: UserVehicleDetailsComponent, canActivate: [
> AuthGuard('everyone')] },
>
> Regards
> Sander
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.