openaire-library/searchPages/searchUtils/searchResultsPerPage.compon...

31 lines
810 B
TypeScript

import {Component, Input, Output, EventEmitter} from '@angular/core';
@Component({
selector: 'search-results-per-page',
template: `
<span> Results per page:</span>
<select class="uk-select uk-width-auto uk-text-bold" id="form-horizontal-select" name="select_results_per_page"
[(ngModel)]="size" (ngModelChange)="sizeChanged()">
<option [ngValue]="5" > 5</option>
<option [ngValue]="10">10</option>
<option [ngValue]="20">20</option>
<option [ngValue]="50">50</option>
</select>
`
})
export class SearchResultsPerPageComponent {
@Input() size: number;
@Output() sizeChange = new EventEmitter();
constructor () {}
ngOnInit() {}
sizeChanged() {
this.sizeChange.emit({
value: this.size
});
}
}