Revision 55964
Added by Argiro Kokogiannaki almost 5 years ago
isCommunity.guard.ts | ||
---|---|---|
4 | 4 |
CanActivate, |
5 | 5 |
ActivatedRouteSnapshot, |
6 | 6 |
RouterStateSnapshot, |
7 |
CanLoad, Route |
|
7 |
CanLoad, Route, UrlSegment
|
|
8 | 8 |
} from '@angular/router'; |
9 |
import {Observable} from 'rxjs/Observable';
|
|
10 |
import 'rxjs/add/operator/filter'; |
|
9 |
import {Observable} from 'rxjs'; |
|
10 |
|
|
11 | 11 |
import {ConnectHelper} from '../connectHelper'; |
12 | 12 |
|
13 | 13 |
@Injectable() |
... | ... | |
29 | 29 |
return this.check(route.queryParams['communityId']); |
30 | 30 |
} |
31 | 31 |
|
32 |
canLoad(route: Route): Observable<boolean> | Promise<boolean> | boolean { |
|
32 |
canLoad(route: Route, segments: UrlSegment[]): Observable<boolean> | Promise<boolean> | boolean {
|
|
33 | 33 |
const path = '/' + route.path + document.location.search; |
34 | 34 |
return this.check(ConnectHelper.getCommunityFromPath(path)); |
35 | 35 |
} |
Also available in: Unified diff
[Library|Trunk]
Merge into trunk branch angular7 rev 55729