Custom directive with templateUrl and ng-repeat

前端 未结 1 654
野的像风
野的像风 2021-01-15 00:11

I\'ve been reseaching this issue for hours, and finally i reproduced it on plunker.

Here\'s my issue:

When a customized directive which using external reso

相关标签:
1条回答
  • 2021-01-15 00:30

    I did some research and it seems you're not alone in this issue:

    https://github.com/angular/angular.js/issues/2151

    User ishw mentions, as a quick fix:

    "For those who may have not realized it yet: it's because your ng-repeat is on the root element in your directive's template. Wrap your ng-repeat in any element and it'll be fine."

    I tried this with your plunkr and it seems to be working:

      <div> 
          <div class="topic" ng-bind="topic.content" ng-click="reply()"></div>
          <div ng-repeat="reply in topic.replys"><reply></reply></div>
      </div>
    
    0 讨论(0)
提交回复
热议问题