import { Injectable } from '@angular/core' ; import { CmdbType } from '../models/cmdb-type' ; import { ActivatedRouteSnapshot , Resolve , RouterStateSnapshot } from '@angular/router' ; import { Observable } from 'rxjs' ; import { TypeService } from '../services/type.service' ; /**
 * Service class for resolving a typeID to a `CmdbType`.
 */ @ Injectable ( { providedIn : 'root' } ) export class TypeResolver implements Resolve < CmdbType > { constructor ( private typeService ) { } param route param state public resolve ( route , state ) { const typeID = + route . paramMap . get ( 'typeID' ) ; return this . typeService . getType ( typeID ) ; } }