{"action":"created","issue":{"url":"https://api.github.com/repos/esvit/ng-table/issues/609","labels_url":"https://api.github.com/repos/esvit/ng-table/issues/609/labels{/name}","comments_url":"https://api.github.com/repos/esvit/ng-table/issues/609/comments","events_url":"https://api.github.com/repos/esvit/ng-table/issues/609/events","html_url":"https://github.com/esvit/ng-table/issues/609","id":75605775,"number":609,"title":"Pagination not showing on first load of server data","user":{"login":"Kizmar","id":606842,"avatar_url":"https://avatars.githubusercontent.com/u/606842?v=3","gravatar_id":"","url":"https://api.github.com/users/Kizmar","html_url":"https://github.com/Kizmar","followers_url":"https://api.github.com/users/Kizmar/followers","following_url":"https://api.github.com/users/Kizmar/following{/other_user}","gists_url":"https://api.github.com/users/Kizmar/gists{/gist_id}","starred_url":"https://api.github.com/users/Kizmar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kizmar/subscriptions","organizations_url":"https://api.github.com/users/Kizmar/orgs","repos_url":"https://api.github.com/users/Kizmar/repos","events_url":"https://api.github.com/users/Kizmar/events{/privacy}","received_events_url":"https://api.github.com/users/Kizmar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-12T13:37:54Z","updated_at":"2015-08-06T11:37:58Z","closed_at":null,"body":"I'm running into a scenario where the ngTable pagination won't show on the initial page load when using ajax data. As soon as you interact with the table (sort or filter), the pagination shows up.\r\n\r\nCurrently I'm resolving the response data straight to the getData() function (not dropping it on $scope). I tried setting a $scope.total in the getStuff() function and setting \"total: $scope.total\", but that didn't work either.\r\n\r\nI've tried SEVERAL variations of this code to get this working and I've failed every time. What am I missing here? I've even tried hard-coding the \"total\" to 400 and it still doesn't show the pagination controls.\r\n\r\nWhen the page loads (code simplified a bit)...\r\n```\r\n$scope.tableParams = new ngTableParams({\r\n    page: 1,\r\n    count: 10,\r\n    sorting: { fieldName: 'asc' },\r\n    filter: {}\r\n}, {\r\n    total: 0, // ???\r\n    getData: function ($defer, params) {\r\n        getStuff(params).then(function (results) {\r\n            $timeout(function () { // tried with and without the timeout... no change\r\n                params.total(results.Total); // not working on initial load\r\n                $defer.resolve(results.Data);\r\n            }, 500);\r\n        });\r\n    }\r\n});\r\n\r\nfunction getStuff(params) {\r\n    var paramData = $scope.getQueryParams(params); // gets a custom object\r\n    var deferred = $q.defer();\r\n    var req = {\r\n        method: 'GET',\r\n        url: '/api/call/url',\r\n        data: paramData\r\n    };\r\n\r\n    $http(req).then(function (results) {\r\n        deferred.resolve(results.data);\r\n    }, function (err) {\r\n        deferred.reject(err);\r\n    });\r\n\r\n    return deferred.promise;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/esvit/ng-table/issues/comments/128336315","html_url":"https://github.com/esvit/ng-table/issues/609#issuecomment-128336315","issue_url":"https://api.github.com/repos/esvit/ng-table/issues/609","id":128336315,"user":{"login":"christianacca","id":886590,"avatar_url":"https://avatars.githubusercontent.com/u/886590?v=3","gravatar_id":"","url":"https://api.github.com/users/christianacca","html_url":"https://github.com/christianacca","followers_url":"https://api.github.com/users/christianacca/followers","following_url":"https://api.github.com/users/christianacca/following{/other_user}","gists_url":"https://api.github.com/users/christianacca/gists{/gist_id}","starred_url":"https://api.github.com/users/christianacca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianacca/subscriptions","organizations_url":"https://api.github.com/users/christianacca/orgs","repos_url":"https://api.github.com/users/christianacca/repos","events_url":"https://api.github.com/users/christianacca/events{/privacy}","received_events_url":"https://api.github.com/users/christianacca/received_events","type":"User","site_admin":false},"created_at":"2015-08-06T11:37:58Z","updated_at":"2015-08-06T11:37:58Z","body":"Also you might want to try the new release [0.8.2](https://github.com/esvit/ng-table/releases/tag/v0.8.2) as https://github.com/esvit/ng-table/commit/7aa4260c8a2882f651af66bfafb271a37569cbaa refactors how the pager receives events telling it when to refresh."}}