Skip to content

Commit

Permalink
Updated ng-table support up to v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andresmatasuarez committed Aug 17, 2020
1 parent cd216ca commit 771d3a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"peerDependencies": {
"angular": "^1.4.3",
"ng-table": "^0.5.4"
"ng-table": "^1.0.0"
},
"devDependencies": {
"angular-ui-publisher": "^1.2.8",
Expand Down
12 changes: 3 additions & 9 deletions src/ng_table_async.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,11 @@ module.directive 'ngTableAsync', ($q, ngTableParams) ->

$scope.mainScope = $scope

$scope.tableParams = new ngTableParams
$scope.tableParams = new NgTableParams
page : $scope.options.defaultPage
count : $scope.options.pageSize
,
# '$scope: $scope' line added to avoid
# "TypeError: Cannot read property '$on' of null"
# src: https://github.com/esvit/ng-table/issues/182
$scope: $scope

getData: ($defer, params) ->
getData: (params) ->
$scope.loading = true

skip = (params.page() - 1) * params.count()
Expand All @@ -160,9 +155,8 @@ module.directive 'ngTableAsync', ($q, ngTableParams) ->
pagePromise
.then (results) ->
$scope.tableParams.total results[0]
$defer.resolve results[1]
delete $scope.loading
$defer.promise
results[1]

$scope.$on 'ng-table-async:reload', ->
$scope.loading = true
Expand Down

0 comments on commit 771d3a7

Please sign in to comment.