TypeError:DTOptionsBuilder.newOptions不是函数-Angular js数据表中的错误

时间:2018-06-27 06:47:53

标签: angularjs datatable

我已经创建了用于绑定数据表的代码。我不知道该怎么办?如何解决此问题。欢迎提出任何建议。

app.controller('ImporatanceTypeCtrl', ['$scope', '$http', '$state', 'httpService', '$modal', '$log', '$stateParams', function ($scope, $state, httpService, $modal, $log, $stateParams, DTOptionsBuilder, $http) {
 $scope.dtOptions = DTOptionsBuilder.newOptions()
   .withDOM(
          "<'row'<'col-sm-12'tr>>" +
          "<SSS<'col-sm-5'l><'col-sm-7'p>>"); 

//My Function Codes Here..

}

1 个答案:

答案 0 :(得分:0)

依赖注入只是一个小问题。您的代码应如下所示:

app.controller('ImporatanceTypeCtrl', ['$scope', '$state', 'httpService', '$modal', '$log', '$stateParams', 'DTOptionsBuilder', '$http', function ($scope, $state, httpService, $modal, $log, $stateParams, DTOptionsBuilder, $http) {

有关依赖项注入的Angularjs文档:https://docs.angularjs.org/guide/di