Project

General

Profile

1 53918 konstantin
import {Component, Input, Output, EventEmitter} from '@angular/core';
2
3
@Component({
4
    selector: 'search-results-per-page',
5 55209 k.triantaf
    template: `
6 58130 konstantin
    <span> Results per page:</span>
7 58235 konstantin
    <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 53918 konstantin
    `
17
})
18
19
export class SearchResultsPerPageComponent {
20
    @Input() size: number;
21
    @Output() sizeChange  = new EventEmitter();
22
23
    constructor () {}
24
25 54775 konstantin
    ngOnInit() {}
26 53918 konstantin
27
    sizeChanged() {
28
      this.sizeChange.emit({
29
          value: this.size
30
      });
31
    }
32
}