import { Injectable } from '@angular/core' ; import { ActivatedRouteSnapshot , Resolve , RouterStateSnapshot } from '@angular/router' ; import { Observable } from 'rxjs' ; import { AuthService } from '../services/auth.service' ; import { AuthProvider } from '../models/providers' ; @ Injectable ( { providedIn : 'root' } ) export class ProviderResolver implements Resolve < Array < AuthProvider > > { constructor ( private authService ) { } resolve ( route , state ) { return this . authService . getProviders ( ) ; } }