import {Component, Input} from '@angular/core';
import {properties} from "../../../../environments/environment";
@Component({
selector: 'organizationsTab',
template: `
No organizations available
0">
pageSize" class="uk-margin-bottom">
{{organizations.length | number}} organizations, page {{organizationsPage | number}} of {{totalPages(organizations.length) | number}}
`
})
export class OrganizationsTabComponent {
@Input() organizations: {"name": string, "id": string}[];
public organizationsPage: number = 1;
public pageSize: number = 10;
public url = properties.searchLinkToDataProvider.split('?')[0];
constructor () {}
ngOnInit() {}
ngOnDestroy() {}
totalPages(totalResults: number): number {
let totalPages:any = totalResults/this.pageSize;
if(!(Number.isInteger(totalPages))) {
totalPages = (parseInt(totalPages, this.pageSize) + 1);
}
return totalPages;
}
updateOrganizationsPage($event) {
this.organizationsPage = $event.value;
}
}