I built a module A and put it into a package via
call npm run build-release
call npm pack dist/
Then I installed it to another Angular module B with
npm install
Module A has a component that I use in module B, this component (in A) injects a router in its constructor and subscribes to router events:
constructor(private router: Router)
I keep getting an error from this component:
BComponent.html:8 ERROR Error: StaticInjectorError(AppModule)[AComponent -> Router]:
StaticInjectorError(Platform: core)[AComponent -> Router]:
NullInjectorError: No provider for Router!
Do I have to provide the Router of BComponent to AComponent somehow?
Everything works fine for each module itself and also if I just copy AModule into BModule. The error only occurs if I pack AModule and install it via npm in BModule.