paging
This commit is contained in:
parent
8926299caa
commit
6df0999844
|
@ -8,10 +8,9 @@ export const COMPONENT = {
|
|||
bindings: {
|
||||
client: '<'
|
||||
},
|
||||
controller: function($http, $state)
|
||||
{
|
||||
controller: function($http, $state) {
|
||||
var self = this;
|
||||
let numPerPage = 2;
|
||||
let numPerPage = 5;
|
||||
let numRecords = 0;
|
||||
|
||||
this.$onChanges = function(changes) {
|
||||
|
@ -31,13 +30,14 @@ export const COMPONENT = {
|
|||
);
|
||||
};
|
||||
$http.get('/client/api/Addresses').then(
|
||||
json => this.addresses = json.data
|
||||
json => {
|
||||
this.addresses = json.data;
|
||||
}
|
||||
);
|
||||
|
||||
this.getNumPages = () => {
|
||||
var nPages = numRecords / numPerPage;
|
||||
if (nPages > 0)
|
||||
self.numPages = (nPages % 2) ? Math.ceil(nPages) : Math.ceil(nPages) + 1;
|
||||
self.numPages = Math.ceil(nPages);
|
||||
};
|
||||
|
||||
this.figureOutToDisplay = () => {
|
||||
|
|
Loading…
Reference in New Issue