Top "Angular2-guards" questions

When a user wants to get access to a specific route on an Angular application, Guards comes in action verifying accesses and validating if that user is authorized to get access to that route.

Angular 2 get current route in guard

I have an AccessGuard class in my project which its work is to determine if user can access to the …

angular angular2-routing angular2-guards
How to unit-test canActivate guard method of angular2 using Jasmine?

Sorry for asking this type of question. But I'm not able to find any blog or youtube tutorials on writing …

unit-testing angular jasmine angular2-guards
angular2: CanDeactivate guard

I've created a CanDeactivate guard which returns an observable and it's applied to a component which is loaded in a …

angular angular2-routing angular2-guards
Angular 2 roles and permissions

I have used angular2 and laravel 5.3 in my project. in laravel when user logged in server will be send the …

angular angular2-routing angular2-guards
Angular2 route guard returning Observable<bool>, how to handle errors

I have a route guard like below @Injectable() export class AuthGuard implements CanActivate { constructor(private router: Router, private authenticationSvc: AuthenticationService) { } …

javascript angular typescript rxjs angular2-guards
Angular2: Global Guard (user has to be logged in always)

I'm building an application where there's no access at all for unauthenticated users. I wrote a LoggedInGuard, but now I …

angular typescript angular2-routing angular2-guards
Using a base guard for all routes in Angular 2 application

Is there a way to set a "base" canActivate when configuring routes in Angular2? So that all routes are covered …

angular angular2-routing angular2-guards
Getting "No provider error" when using CanActivate guard

This is the guard: // my.guard.ts import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot } from '@angular/…

angular angular2-routing angular2-guards
Angular 2 How to Apply Multiple Guards with Or-Relationship on the Same Path

My application allows access to contents based on user roles. I wrote a Router Guard for each role. Some contents …

angular angular2-routing angular2-guards
Trying to understand the differences between CanActivate and CanActivateChild

So, I'm trying to protect the access to several routes by using guards. I'm using the following routes to do …

angular angular2-guards