My current setup includes Angular version 2.4.4.
However, I encountered an issue when trying to declare a service resolver and register it in both the component module and router.
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Rx';
import { PGService, PG} from '../pg/';
@Injectable()
export class HomeServiceResolver implements Resolve<any> {
constructor(
private pgService: PGService
) { }
resolve(route: ActivatedRouteSnapshot): Observable<PG> {
return Observable.from([new PG()]);
}
}
This error message is displayed:
vendor.dll.js:73630 Error: Uncaught (in promise): Error: Token must be defined!
Error: Token must be defined!
...
What could be causing this issue?