diff options
Diffstat (limited to 'client/src/app/app.resolver.ts')
-rw-r--r-- | client/src/app/app.resolver.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/client/src/app/app.resolver.ts b/client/src/app/app.resolver.ts new file mode 100644 index 000000000..45774b8d1 --- /dev/null +++ b/client/src/app/app.resolver.ts | |||
@@ -0,0 +1,18 @@ | |||
1 | import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; | ||
2 | import { Injectable } from '@angular/core'; | ||
3 | import { Observable } from 'rxjs/Observable'; | ||
4 | import 'rxjs/add/observable/of'; | ||
5 | |||
6 | @Injectable() | ||
7 | export class DataResolver implements Resolve<any> { | ||
8 | public resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { | ||
9 | return Observable.of({ res: 'I am data'}); | ||
10 | } | ||
11 | } | ||
12 | |||
13 | /** | ||
14 | * An array of services to resolve routes with data. | ||
15 | */ | ||
16 | export const APP_RESOLVER_PROVIDERS = [ | ||
17 | DataResolver | ||
18 | ]; | ||