{"action":"created","issue":{"url":"https://api.github.com/repos/esvit/ng-table/issues/575","labels_url":"https://api.github.com/repos/esvit/ng-table/issues/575/labels{/name}","comments_url":"https://api.github.com/repos/esvit/ng-table/issues/575/comments","events_url":"https://api.github.com/repos/esvit/ng-table/issues/575/events","html_url":"https://github.com/esvit/ng-table/issues/575","id":63197748,"number":575,"title":"AJAX with $defer.resolve doesn't work","user":{"login":"SantjagoCorkez","id":9654644,"avatar_url":"https://avatars.githubusercontent.com/u/9654644?v=3","gravatar_id":"","url":"https://api.github.com/users/SantjagoCorkez","html_url":"https://github.com/SantjagoCorkez","followers_url":"https://api.github.com/users/SantjagoCorkez/followers","following_url":"https://api.github.com/users/SantjagoCorkez/following{/other_user}","gists_url":"https://api.github.com/users/SantjagoCorkez/gists{/gist_id}","starred_url":"https://api.github.com/users/SantjagoCorkez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SantjagoCorkez/subscriptions","organizations_url":"https://api.github.com/users/SantjagoCorkez/orgs","repos_url":"https://api.github.com/users/SantjagoCorkez/repos","events_url":"https://api.github.com/users/SantjagoCorkez/events{/privacy}","received_events_url":"https://api.github.com/users/SantjagoCorkez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-20T09:38:11Z","updated_at":"2015-08-10T12:38:32Z","closed_at":null,"body":"The scope is defined as:\r\n```javascript\r\n        loadData: function($defer, params) {\r\n            if (me.load_data_timeout) {\r\n                $timeout.cancel(me.load_data_timeout);\r\n            }\r\n            me.load_data_timeout = $timeout(function() {\r\n                $scope.loading = true;\r\n                params.total(0);\r\n                $http.post('/url/for/data', {\r\n                    filters: $scope.filters,\r\n                    sorting: params.sorting(),\r\n                    limit: params.count(),\r\n                    skip: params.page()\r\n                }).success(function(data) {\r\n                    $timeout(function() {\r\n                        params.total(data.count);\r\n                        $defer.resolve(data.items);\r\n                    }, 500);\r\n                }).finally(function() {\r\n                    $scope.loading = false;\r\n                });\r\n            }, 2000);\r\n        }\r\n...\r\n        table: new ngTableParams({\r\n            page: 1,\r\n            count: 25,\r\n            sorting: {\r\n                'id': 'desc'\r\n            }\r\n        }, {\r\n            total: 0,\r\n            getData: me.loadData\r\n        }),\r\n```\r\n\r\nThe first time the `getData` executes (with either filters or not) it fills the table with data as expected; My pagination template has `ng-hide=\"pages.length == 0\"` check so it reflects the amount of data correctly; With any subsequent getData call the request returns another data set (or even empty), the pagination reflects the new items count but the table itself (and it's scope $data parameter) does not update to the result set."},"comment":{"url":"https://api.github.com/repos/esvit/ng-table/issues/comments/129428358","html_url":"https://github.com/esvit/ng-table/issues/575#issuecomment-129428358","issue_url":"https://api.github.com/repos/esvit/ng-table/issues/575","id":129428358,"user":{"login":"chillyistkult","id":1689047,"avatar_url":"https://avatars.githubusercontent.com/u/1689047?v=3","gravatar_id":"","url":"https://api.github.com/users/chillyistkult","html_url":"https://github.com/chillyistkult","followers_url":"https://api.github.com/users/chillyistkult/followers","following_url":"https://api.github.com/users/chillyistkult/following{/other_user}","gists_url":"https://api.github.com/users/chillyistkult/gists{/gist_id}","starred_url":"https://api.github.com/users/chillyistkult/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chillyistkult/subscriptions","organizations_url":"https://api.github.com/users/chillyistkult/orgs","repos_url":"https://api.github.com/users/chillyistkult/repos","events_url":"https://api.github.com/users/chillyistkult/events{/privacy}","received_events_url":"https://api.github.com/users/chillyistkult/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T12:38:32Z","updated_at":"2015-08-10T12:38:32Z","body":"Looks like the current release solves the issue."}}