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

37 lines
1.0 KiB
TypeScript
Raw Normal View History

import {Component, Input, Output, EventEmitter} from '@angular/core';
@Component({
selector: 'search-results-per-page',
template: `
<div>
<mat-form-field class="matSelectionFormField">
<mat-label>Results per page:</mat-label>
<mat-select [(ngModel)]="size" (ngModelChange)="sizeChanged()"
[disableOptionCentering]="true"
panelClass="matSelectionPanel"
class="uk-text-bold matSelection">
<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>
</mat-form-field>
</div>
`
})
export class SearchResultsPerPageComponent {
@Input() size: number;
@Output() sizeChange = new EventEmitter();
constructor () {}
ngOnInit() {}
sizeChanged() {
this.sizeChange.emit({
value: this.size
});
}
}