我在调用函数时遇到以下错误
Error: [$interpolate:interr] Can't interpolate: {{getButtonText()}}
TypeError: Cannot read property 'length' of undefined
http://errors.angularjs.org/1.2.3/$interpolate/interr?p0=%7B%7BgetButtonTex…%A0&p1=TypeError%3A%20Cannot%20read%20property%20'length'%20of%20undefined
at angular.js:78
at Object.$get.fn (angular.js:8139)
at Scope.$get.Scope.$digest (angular.js:11528)
at Scope.$get.Scope.$apply (angular.js:11774)
at HTMLDocument.<anonymous> (angularjs-dropdown-multiselect.js:164)
at HTMLDocument.n.event.dispatch (jquery-2.1.1.min.js:3)
at HTMLDocument.n.event.add.r.handle (jquery-2.1.1.min.js:3)(anonymous function) @ angular.js:9193
相同的代码适用于其他页面,但不适用于此页面。
HTML代码:
<td>
<span>
<img src="images/note.png" class="imgComment" ng-mouseover="this.style.cursor='hand'"
ng-mouseleave="this.style.cursor='auto'" style="width:30px"
ng-click="edit({{item.userId}})"></img>
</span>
</td>
Javascript
$scope.edit = function(recordId) {
var modalInstance = $modal.open({
templateUrl: 'editView.html',
controller: 'EditController',
backdrop: 'static',
resolve: {
recordId: function() {
return recordId;
},
resourceName: function() {
return $scope.resourceName;
},
deptId : function () {
return $scope.dept;
}
}
});
有关可能导致错误的原因的任何想法?