RxJs 订阅不会在根 angular 模块中触发

RxJs Subscription does not get fired in the root angular module

我有一个组件可以侦听用于显示加载器的 http 调用。我有一个微调器组件和一个微调器服务,它有一个 spinnerEvent$ Angular4 事件发射器。这是我的组件构造函数。

constructor(
    private spinnerService: SpinnerService
) {
    this.subscription = spinnerService.spinnerEvent$.subscribe((spinnerEvent: any) => this.updateSpinnerState(spinnerEvent));
    console.log(this.subscription);
}

对于 angular 应用程序正在使用延迟加载。问题是我想将此组件添加到路由器出口下方的 app.component.html 但这样做时,我的订阅方法永远不会被触发。订阅显示在我的日志中。当我将相同的组件放在子模块上时,订阅开始工作。 spinner 组件和 spinner 服务都在一个已注入 app.module.ts 的共享模块中。我不确定是什么导致了订阅行为的这种差异。

当我将微调器组件和微调器服务从共享模块中移出并在 app.module 中定义时,这个问题得到了解决。目前正在尝试了解原因,因为我的 app.module 之前从共享模块导入了组件。