This commit is contained in:
Vicente Falco 2017-01-18 08:41:22 +01:00
parent 8926299caa
commit 6df0999844
1 changed files with 6 additions and 6 deletions

View File

@ -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 = () => {