Stop AngularJS inserting using ng-include

前端 未结 2 954
不思量自难忘°
不思量自难忘° 2021-01-14 09:49

I\'m using the Foundation layout framework, which automatically floats the last sibling of .column to the right and I really appreciate this is a behaviour. How

相关标签:
2条回答
  • 2021-01-14 10:31

    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).

    0 讨论(0)
  • 2021-01-14 10:39

    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).

    0 讨论(0)
提交回复
热议问题