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

33 lines
912 B
TypeScript
Raw Normal View History

import {Component, Input, Output, EventEmitter} from '@angular/core';
@Component({
selector: 'search-results-per-page',
template: `
<span class="uk-width-2-3@m uk-width-1-1@s">
<span class="uk-width-5-6@m"> Results per page:</span>
<select class="uk-select uk-width-1-6@m uk-width-auto" 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>
</span>
`
})
export class SearchResultsPerPageComponent {
@Input() size: number;
@Output() sizeChange = new EventEmitter();
constructor () {}
ngOnInit() {}
sizeChanged() {
this.sizeChange.emit({
value: this.size
});
}
}