import { Injectable } from '@angular/core' ; import { Resolve , RouterStateSnapshot , ActivatedRouteSnapshot } from '@angular/router' ; import { Observable } from 'rxjs/Observable' ; import { LocalStorageService } from 'ng2-webstorage' ; @ Injectable ( ) export class NickResolver implements Resolve < any > { param { LocalStorageService } localStorage constructor ( private localStorage ) { } param { ActivatedRouteSnapshot } route param { RouterStateSnapshot } state returns { any | string } resolve ( route , state ) { return this . localStorage . retrieve ( 'nick' ) ; } }