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: `
|
2018-11-21 16:24:14 +01:00
|
|
|
<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 () {}
|
|
|
|
|
2019-02-14 11:15:44 +01:00
|
|
|
ngOnInit() {}
|
2018-11-21 16:24:14 +01:00
|
|
|
|
|
|
|
sizeChanged() {
|
|
|
|
this.sizeChange.emit({
|
|
|
|
value: this.size
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|