1
|
import {Component, Input, Output, EventEmitter} from '@angular/core';
|
2
|
|
3
|
@Component({
|
4
|
selector: 'search-results-per-page',
|
5
|
template: `
|
6
|
<span> Results per page:</span>
|
7
|
<mat-select class="uk-select uk-width-auto uk-text-bold matSelection" id="form-horizontal-select" name="select_results_per_page"
|
8
|
[(ngModel)]="size" (ngModelChange)="sizeChanged()"
|
9
|
[disableOptionCentering]="true"
|
10
|
panelClass="matSelectionPanel">
|
11
|
<mat-option [value]="5" > 5</mat-option>
|
12
|
<mat-option [value]="10">10</mat-option>
|
13
|
<mat-option [value]="20">20</mat-option>
|
14
|
<mat-option [value]="50">50</mat-option>
|
15
|
</mat-select>
|
16
|
`
|
17
|
})
|
18
|
|
19
|
export class SearchResultsPerPageComponent {
|
20
|
@Input() size: number;
|
21
|
@Output() sizeChange = new EventEmitter();
|
22
|
|
23
|
constructor () {}
|
24
|
|
25
|
ngOnInit() {}
|
26
|
|
27
|
sizeChanged() {
|
28
|
this.sizeChange.emit({
|
29
|
value: this.size
|
30
|
});
|
31
|
}
|
32
|
}
|