1
|
import { Component } from '@angular/core';
|
2
|
import { Query } from './model/Query';
|
3
|
import { QueryService} from './services/query.service';
|
4
|
import { QueryResponse } from './model/QueryResponse';
|
5
|
|
6
|
@Component({
|
7
|
selector: 'app-root',
|
8
|
templateUrl: './app.component.html',
|
9
|
styleUrls: ['./app.component.css']
|
10
|
})
|
11
|
export class AppComponent {
|
12
|
title = 'Fulltext search';
|
13
|
response: QueryResponse = new QueryResponse();
|
14
|
|
15
|
constructor(private queryService: QueryService) { }
|
16
|
|
17
|
sendQuery(temp: Query) {
|
18
|
console.log(temp);
|
19
|
temp.date = new Date();
|
20
|
this.queryService.sendQuery(temp).subscribe( response => {
|
21
|
this.response = response;
|
22
|
});
|
23
|
}
|
24
|
}
|