AngularJs: ng-include not working when placed inside a ng-view tag

我们两清 提交于 2019-12-05 15:06:05

The url to the file should be relative to your index.html (main html file). If your structure is like this:

index.html
template
    template1.html
    template2.html

and in template1 you want to ng-include template2.html, you should do

<div ng-include="'template/template2.html'"></div>

Here is a working example.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!