Project

General

Profile

1
import {Component, Input, Output, EventEmitter} from '@angular/core';
2

    
3
@Component({
4
    selector: 'search-results-per-page',
5
    template: `
6
      <div>
7
        <mat-form-field class="matSelectionFormField">
8
          <mat-label>Results per page:</mat-label>
9
          <mat-select  [(ngModel)]="size" (ngModelChange)="sizeChanged()"
10
                       [disableOptionCentering]="true"
11
                       panelClass="matSelectionPanel"
12
                       class="uk-text-bold matSelection">
13
            <mat-option [value]="5" > 5</mat-option>
14
            <mat-option [value]="10">10</mat-option>
15
            <mat-option [value]="20">20</mat-option>
16
            <mat-option [value]="50">50</mat-option>
17
          </mat-select>
18
        </mat-form-field>
19
      </div>
20
    `
21
})
22

    
23
export class SearchResultsPerPageComponent {
24
    @Input() size: number;
25
    @Output() sizeChange  = new EventEmitter();
26

    
27
    constructor () {}
28

    
29
    ngOnInit() {}
30

    
31
    sizeChanged() {
32
      this.sizeChange.emit({
33
          value: this.size
34
      });
35
    }
36
}
(48-48/55)