Projekt

Obecné

Profil

Stáhnout (863 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1
import { Component, OnInit } from '@angular/core';
2
import { SearchRequest } from '../../../model/SearchRequest';
3
import { QueryService } from '../../../services/query.service';
4
import { Router } from '@angular/router';
5

    
6
@Component({
7
  selector: 'app-search-box',
8
  templateUrl: './search-box.component.html',
9
  styleUrls: ['./search-box.component.css']
10
})
11
export class SearchBoxComponent implements OnInit {
12
  expression: string;
13

    
14

    
15
  constructor(private queryService: QueryService, private router: Router) { }
16

    
17
  ngOnInit(): void {
18
  }
19

    
20
  onSubmit() {
21
    const searchRequest: SearchRequest = new SearchRequest(this.expression, new Date());
22

    
23
    //TODO: naimplementovat searchPost
24
    /*
25
    this.queryService.searchPost(searchRequest).subscribe (() => {
26
      //TODO: ulozit objekt SearchResponse[]
27

    
28
      this.router.navigate(['/search']);
29
    });
30
    */
31
  }
32
}
(4-4/4)