angular2 ng-template in a separate file

前端 未结 5 923
孤城傲影
孤城傲影 2021-02-19 09:05

angular2 how to use ng-template from a different file? When I place the ng-template within the same HTML where I use it works but when I move ng-template into a separate file th

5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-19 09:52

    Have you seen this? https://github.com/angular/angular/issues/27503 There is an example there provided by dawidgarus

    The suggestion is that if you want to reuse your template in different files, you should convert what is inside the template into a separate component, then you can reuse that component wherever you want.

提交回复
热议问题