/** Angular Imports */ import { Injectable } from '@angular/core' ; import { Resolve , ActivatedRouteSnapshot } from '@angular/router' ; /** rxjs Imports */ import { Observable } from 'rxjs' ; /** Custom Services */ import { TemplatesService } from '../templates.service' ; /**
 * Template data resolver.
 */ @ Injectable ( ) export class TemplateResolver implements Resolve < Object > { param { TemplatesService } templatesService constructor ( private templatesService ) { } returns { Observable < any > } resolve ( route ) { const templateId = route . paramMap . get ( 'id' ) ; return this . templatesService . getTemplate ( templateId ) ; } }