search.component.ts 843 Bytes
Newer Older
Vitali Stupin's avatar
Initial    
Vitali Stupin committed
1
import { Component, OnInit } from '@angular/core';
Vitali Stupin's avatar
Vitali Stupin committed
2
import { SubsystemsService } from '../../subsystems.service';
Vitali Stupin's avatar
Initial    
Vitali Stupin committed
3
4
5
6
7
8
9
10

@Component({
  selector: 'app-search',
  templateUrl: './search.component.html',
  styleUrls: ['./search.component.css']
})
export class SearchComponent implements OnInit {

Vitali Stupin's avatar
Vitali Stupin committed
11
12
13
  limit: string;
  nonEmpty: boolean;
  filter: string;
Vitali Stupin's avatar
Vitali Stupin committed
14

Vitali Stupin's avatar
Vitali Stupin committed
15
  constructor(private subsystemsService: SubsystemsService) { }
Vitali Stupin's avatar
Initial    
Vitali Stupin committed
16

Vitali Stupin's avatar
Vitali Stupin committed
17
  setNonEmpty(nonEmpty: boolean) {
Vitali Stupin's avatar
Vitali Stupin committed
18
    this.subsystemsService.setNonEmpty(nonEmpty);
Vitali Stupin's avatar
Vitali Stupin committed
19
20
21
  }

  setLimit(limit: string) {
Vitali Stupin's avatar
Vitali Stupin committed
22
    this.subsystemsService.setLimit(limit);
Vitali Stupin's avatar
Vitali Stupin committed
23
24
25
  }

  setFilter(filter: string) {
Vitali Stupin's avatar
Vitali Stupin committed
26
    this.subsystemsService.setFilter(filter);
Vitali Stupin's avatar
Vitali Stupin committed
27
28
  }

Vitali Stupin's avatar
Vitali Stupin committed
29
  ngOnInit() {
Vitali Stupin's avatar
Vitali Stupin committed
30
31
32
    this.limit = this.subsystemsService.getLimit();
    this.nonEmpty = this.subsystemsService.getNonEmpty();
    this.filter = this.subsystemsService.getfilter();
Vitali Stupin's avatar
Vitali Stupin committed
33
  }
Vitali Stupin's avatar
Initial    
Vitali Stupin committed
34
}