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