Replace ng-include node with template?

前端 未结 7 966
感情败类
感情败类 2020-11-30 23:36

Kinda new to angular. Is it possible to replace the ng-include node with the contents of the included template? For example, with:

相关标签:
7条回答
  • 2020-12-01 00:11

    I had the same problem, my 3rd party css stylesheet didn't like the extra DOM-element.

    My solution was super-simple. Just move the ng-include 1 up. So instead of

    <md-sidenav flex class="md-whiteframe-z3" md-component-id="left" md-is-locked-open="$media('gt-md')">
      <div ng-include="myService.template"></span>
    </md-sidenav>
    

    I simply did:

    <md-sidenav flex class="md-whiteframe-z3" md-component-id="left" md-is-locked-open="$media('gt-md')" ng-include="myService.template">
    </md-sidenav>
    

    I bet this will work in most situations, even tho it technically isn't what the question is asking.

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