Revision 55964
Added by Argiro Kokogiannaki almost 5 years ago
freeGuard.guard.ts | ||
---|---|---|
7 | 7 |
Route, |
8 | 8 |
CanLoad |
9 | 9 |
} from '@angular/router'; |
10 |
import {Observable} from 'rxjs/Observable';
|
|
10 |
import {Observable} from 'rxjs'; |
|
11 | 11 |
import {LoginErrorCodes} from './utils/guardHelper.class'; |
12 | 12 |
|
13 | 13 |
@Injectable() |
14 |
export class FreeGuard implements CanActivate, CanLoad {
|
|
14 |
export class FreeGuard implements CanActivate { |
|
15 | 15 |
|
16 | 16 |
constructor(private router: Router) { |
17 | 17 |
} |
... | ... | |
28 | 28 |
return this.check(state.url); |
29 | 29 |
} |
30 | 30 |
|
31 |
canLoad(route: Route): Observable<boolean> | Promise<boolean> | boolean { |
|
32 |
return this.check('/' + route.path); |
|
33 |
} |
|
34 | 31 |
} |
Also available in: Unified diff
[Library|Trunk]
Merge into trunk branch angular7 rev 55729