Javascript 多阿斯特星云>;无法读取属性';追加儿童';空的

Javascript 多阿斯特星云>;无法读取属性';追加儿童';空的,javascript,angular,typescript,toastr,nebular,Javascript,Angular,Typescript,Toastr,Nebular,在导航到特定组件后,我想向大家展示一下星云toastrService。我正在使用行为主题来检查是否应该显示祝酒词 this.messageService.currentMessage.subscribe(msg => { if (msg.showToast){showToast()} } 该代码适用于其他组件,但对于该组件,nebular在创建cdk覆盖容器时抛出消息“无法读取null的属性'appendChild' 提前感谢您的帮助 在app.component.html中用

在导航到特定组件后,我想向大家展示一下星云toastrService。我正在使用行为主题来检查是否应该显示祝酒词

this.messageService.currentMessage.subscribe(msg => {
    if (msg.showToast){showToast()}
}
该代码适用于其他组件,但对于该组件,nebular在创建cdk覆盖容器时抛出消息“无法读取null的属性'appendChild'

提前感谢您的帮助


在app.component.html中用nb布局标签包装路由器插座,如下所示

<nb-layout>
  <nb-layout-column>
    <router-outlet></router-outlet>
  </nb-layout-column>
</nb-layout>


不要在angular中使用直接DOM操作。改为使用渲染器2。我不能改变这一点,它在星云图书馆里。他不是在操纵Dom,图书馆是。