Stop AngularJS inserting <span class=“ng-scope”></span> using ng-include

≯℡__Kan透↙ 提交于 2019-12-01 08:39:28

Since you indicated the div can be moved inside, this works:

<ng-include src="'main.tmpl'"></ng-include>

Then in your template:

<div class="row">
   <article id="sidepanels" class="four columns">
   ...
</div>

I'm not aware of any way to prevent angular from inserting the span tags (I think it keeps track of scopes that way -- for garbage collection).

Also you can try my version of include directive that does not creates a scope: Gist source.

As no scopes are created, AngularJS should not create additional element to mainain scope (it actually use data attributes to store link to scope).

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