/** Angular Imports */ import { Injectable } from '@angular/core' ; import { Resolve , ActivatedRouteSnapshot } from '@angular/router' ; /** rxjs Imports */ import { Observable } from 'rxjs' ; /** Custom Services */ import { CentersService } from '../centers.service' ; /**
 * Centers data resolver.
 */ @ Injectable ( ) export class CenterViewResolver implements Resolve < Object > { param { CentersService } CentersService constructor ( private centersService ) { } returns { Observable < any > } resolve ( route ) { const centerId = route . paramMap . get ( 'centerId' ) ; return this . centersService . getCenterData ( centerId ) ; } }