import {Component, Input} from "@angular/core";
@Component({
selector: 'results-and-pages',
template: `
{{totalResults | number}}
{{type}}, page
{{page}}
of
{{getTotalPages() | number}}
`
})
export class ResultsAndPagesNumComponent {
@Input() type: string;
@Input() page: number = 1;
@Input() pageSize: number = 10;
@Input() totalResults: number;
@Input() customClasses: string = "";
constructor() {}
getTotalPages(){
let total: number;
let i= this.totalResults/this.pageSize;
let integerI=parseInt(''+i);
total = parseInt(''+((i==integerI)?i:i+1));
return total;
}
}