Using Inline Templates in AngularJS

前端 未结 2 742
情歌与酒
情歌与酒 2020-11-29 20:47

I wanted to load an inline view template.

I wrapped the template in a script tag of type text/ng-template and set the id to temp1.html. and

2条回答
  •  天命终不由人
    2020-11-29 21:18

    Ody, you were on the right track, the only problem was that the tags are outside of the DOM element on which the ng-app directive is used. If you move it to the element in-line templates should work.

    You might also find this question relevant: Is there a way to make AngularJS load partials in the beginning and not at when needed?

提交回复
热议问题