/** Angular Imports */ import { Injectable } from '@angular/core' ; import { Resolve , ActivatedRouteSnapshot } from '@angular/router' ; /** rxjs Imports */ import { Observable } from 'rxjs' ; /** Custom Services */ import { ProductsService } from '../../products.service' ; /**
 * Share product and template data resolver.
 */ @ Injectable ( ) export class ShareProductAndTemplateResolver implements Resolve < Object > { param { ProductsService } productsService constructor ( private productsService ) { } returns { Observable < any > } resolve ( route ) { const shareProductId = route . paramMap . get ( 'id' ) ; return this . productsService . getShareProduct ( shareProductId , true ) ; } }