genetic-resources.component.ts 827 Bytes
Newer Older
Exbrayat Cédric's avatar
Exbrayat Cédric committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';

import { Page } from '../models/page';
import { GeneticResourceModel } from '../models/genetic-resource.model';

@Component({
  selector: 'rare-genetic-resources',
  templateUrl: './genetic-resources.component.html',
  styleUrls: ['./genetic-resources.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class GeneticResourcesComponent {

  @Input() geneticResources: Page<GeneticResourceModel>;

16
17
18
19
20
21
22
23
24
25
26
  get firstResultIndex() {
    return (this.geneticResources.number * this.geneticResources.size) + 1
  }

  get lastResultIndex() {
    return this.firstResultIndex + this.geneticResources.content.length - 1;
  }

  get resultLimited() {
    return this.geneticResources.totalElements > this.geneticResources.maxResults;
  }
Exbrayat Cédric's avatar
Exbrayat Cédric committed
27
}