Angular Directive Does Not Evaluate Inside ng-repeat

后端 未结 6 1736
予麋鹿
予麋鹿 2020-12-30 08:38

I have the following setup:

App/Directive

var app = angular.module(\"MyApp\", []);

app.directive(\"adminRosterItem\", function () {
    return {
            


        
6条回答
  •  忘掉有多难
    2020-12-30 09:43

    Had exact same problem. Had a custom directive in an ng-repeat, table->tr->td->directive, and when sorting the table using ng-repeat and Array.sort the table did change order but the directives did not re-render. The problem was I was using

    track by $index
    

    removed the track by index from the ng-repeat and it was fixed.

提交回复
热议问题