<tbody ui-sortable="sortableOptions" ng-model="model.list">
<tr ng-repeat="item in model.list">
<td>
<div class="form-group">
<input type="text" class="form-control test-input" ng-model="item.Country" ng-readonly="!isEditable">
</div>
</td>
<td>
<div class="form-group">
<input type="text" class="form-control test-input" ng-model="item.Value" ng-readonly="!isEditable">
</div>
</td>
</tr>
以下是控制器中的代码。
$scope.sortableOptions = {
update: function(e, ui) {
console.log(model.list);
},
stop: function(e, ui) {
console.log(model.list);
}
};
我使用了require.js,并添加了依赖ui.sortable
。
每当我打开带有表格的页面时,就会出现以下错误 -
angular.js:12520 TypeError: g.sortable不是一个函数
在w(http://localhost:90/bower_components/angular-ui-sortable/sortable.min.js:8:4649)
在x(http://localhost:90/bower_components/angular-ui-sortable/sortable.min.js:8:4721)
在link(http://localhost:90/bower_components/angular-ui-sortable/sortable.min.js:8:5003)
在http://localhost:90/bower_components/angular/angular.js:8835:44
在invokeLinkFn(http://localhost:90/bower_components/angular/angular.js:8841:9)
在nodeLinkFn(http://localhost:90/bower_components/angular/angular.js:8335:11)
在compositeLinkFn(http://localhost:90/bower_components/angular/angular.js:7731:13)
在nodeLinkFn(http://localhost:90/bower_components/angular/angular.js:8330:24)
在compositeLinkFn(http://localhost:90/bower_components/angular/angular.js:7731:13)
在compositeLinkFn(http://localhost:90/bower_components/angular/angular.js:7734:13)<tbody ui-sortable="sortableOptions" ng-model="model.list" class="ng-pristine ng-untouched ng-valid ng-isolate-scope">
请问您能帮忙解决吗? 提前致谢
ui.sortable
的注入也是正确的。 - Arjun Varrier