前言

  小编最近在用angular组件的ts中控制界面模块显示的时候遇到了这个问题,如下图
Angular——cannot read property 'style' of null at....
  这个问题的原因是因为没有正确的获取模块的id,可以直接从报错这点过去,直接看到是哪里的问题,点击红线就可以了,如下
Angular——cannot read property 'style' of null at....

  跳转到这个位置
Angular——cannot read property 'style' of null at....
  经查看,是id名字的原因,问题解决

总结

  不怕不知道,就怕不知道,路还长,得走稳点。

相关文章: