我想有不少同学遇到这样的错误,当使用replace: true时,出现Error: [$compile:tplrt]错误,如下图:
AngularJS Error: [$compile:tplrt]报错


AngularJS Error: [$compile:tplrt]报错


这是因为在angularJS中,html模板只能由有一个根元素,head.html代码如图
AngularJS Error: [$compile:tplrt]报错
如果将第5行的div标签删掉就正常了,这是因为html模板只能有一个根标签

相关文章:

  • 2022-01-31
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2022-01-24
  • 2021-11-16
  • 2021-10-04
猜你喜欢
  • 2022-12-23
  • 2021-09-17
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-10-02
相关资源
相似解决方案