in the lib, i want to navigate by this.router.navigateByUrl, but got error :
core.js:1449 ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[LoginComponent -> Router]: StaticInjectorError(Platform: core)[LoginComponent -> Router]: NullInjectorError: No provider for Router! Error: StaticInjectorError(AppModule)[LoginComponent -> Router]: StaticInjectorError(Platform: core)[LoginComponent -> Router]: NullInjectorError: No provider for Router!
then i import the router in index.js, Still prompt error. Who can tell me how to do it correctly? thanks a lot.
in the lib, i want to navigate by
this.router.navigateByUrl
, but got error :core.js:1449 ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[LoginComponent -> Router]: StaticInjectorError(Platform: core)[LoginComponent -> Router]: NullInjectorError: No provider for Router! Error: StaticInjectorError(AppModule)[LoginComponent -> Router]: StaticInjectorError(Platform: core)[LoginComponent -> Router]: NullInjectorError: No provider for Router!
then i import the router inindex.js
, Still prompt error. Who can tell me how to do it correctly? thanks a lot.