Ich habe $rootScope._ = window._; in app.run and $scope._ = _;
in Controller eingestellt. Wenn ich jedoch versuche, über _.includes zu evaluieren, werden die darin enthaltenen Variablen gut ausgewertet (das kann ich durch Inspizieren des Elements sehen), aber ng-disable evaluiert keinen booleschen Wert.lodash _.includes nicht zu wahr oder falsch in der Winkelansicht zu bewerten
<li data-ng-repeat="acLink in accordion.links">
href="#/{{acLink.domain}}/{{acLink.id}}" uib-tooltip="{{acLink.title}}" ng-disabled="_.includes({{allowedRoles}},{{acLink.role_d}})" style="color:#4d4d4d">{{acLink.title}}</a>
</li>
<a href="#/abc/home" uib-tooltip="CBOE Home" ng-disabled="_.includes(["abc", "xyz"],'abc')" style="color:#4d4d4d" class="ng-binding" aria-disabled="false"> Home</a>
Ich erhalte die folgende Fehlermeldung:
angular.min.js:103 Error: [$parse:syntax]
at http://localhost:63342/dashboard_core/vendor/angular/angular.min.js:6:416
at hb.throwError (http://localhost:63342/dashboard_core/vendor/angular/angular.min.js:190:254)
at hb.primary (http://localhost:63342/dashboard_core/vendor/angular/angular.min.js:189:477)
at hb.unary (http://localhost:63342/dashboard_core/vendor/angular/angular.min.js:197:82)
at hb.multiplicative (http://localhost:63342/dashboard_core/vendor/angular/angular.min.js:196:324)
at hb.additive (http://localhost:63342/dashboard_core/vendor/angular/angular.min.js:196:182)
at hb.relational (http://localhost:63342/dashboard_core/vendor/angular/angular.min.js:196:48)
at hb.equality (http://localhost:63342/dashboard_core/vendor/angular/angular.min.js:195:418)
at hb.logicalAND (http://localhost:63342/dashboard_core/vendor/angular/angular.min.js:195:294) <a href="#/{{acLink.domain}}/{{acLink.id}}" uib-tooltip="{{acLink.title}}" ng-disabled="_.includes({{allowedRoles}},{{acLink.role_d}})" style="color:#4d4d4d" class="ng-binding">
Besser erstellen Sie eine Funktion anstelle von Inline-JS. – Tushar