1 import {Injectable} from '@angular/core';
2 import {Router, Resolve, RouterStateSnapshot,
3 ActivatedRouteSnapshot} from '@angular/router';
4 import {IdlService} from '@eg/core/idl.service';
5 import {OrgService} from '@eg/core/org.service';
6 import {LocaleService} from '@eg/core/locale.service';
8 // For locale application
12 export class BaseResolver implements Resolve<Promise<void>> {
15 private router: Router,
16 private idl: IdlService,
17 private org: OrgService,
18 private locale: LocaleService
22 * Loads pre-auth data common to all applications.
23 * No auth token is available at this level. When needed, auth is
24 * enforced by application/group-specific resolvers at lower levels.
27 route: ActivatedRouteSnapshot,
28 state: RouterStateSnapshot): Promise<void> {
30 OpenSRF.locale = this.locale.currentLocaleCode();
34 return this.org.fetchOrgs(); // anonymous PCRUD.