2018-11-21 16:24:14 +01:00
|
|
|
import {Component, Input, Output, EventEmitter} from '@angular/core';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'search-results-per-page',
|
2019-04-05 19:21:23 +02:00
|
|
|
template: `
|
2020-02-24 14:33:34 +01:00
|
|
|
<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>
|
2018-11-21 16:24:14 +01:00
|
|
|
`
|
|
|
|
})
|
|
|
|
|
|
|
|
export class SearchResultsPerPageComponent {
|
|
|
|
@Input() size: number;
|
|
|
|
@Output() sizeChange = new EventEmitter();
|
|
|
|
|
|
|
|
constructor () {}
|
|
|
|
|
2019-02-14 11:15:44 +01:00
|
|
|
ngOnInit() {}
|
2018-11-21 16:24:14 +01:00
|
|
|
|
|
|
|
sizeChanged() {
|
|
|
|
this.sizeChange.emit({
|
|
|
|
value: this.size
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|