2016-05-04 17:20:21 +02:00
|
|
|
import {Injectable} from "@angular/core";
|
2016-05-03 21:04:57 +02:00
|
|
|
import {NetworkService} from "../../model/network/network.service";
|
2016-05-04 18:34:54 +02:00
|
|
|
import {AutoCompleteItem} from "../../../../common/entities/AutoCompleteItem";
|
2016-05-03 21:04:57 +02:00
|
|
|
|
|
|
|
@Injectable()
|
2016-05-05 17:51:51 +02:00
|
|
|
export class AutoCompleteService {
|
2016-05-03 21:04:57 +02:00
|
|
|
|
|
|
|
|
2017-06-10 22:32:56 +02:00
|
|
|
constructor(private _networkService: NetworkService) {
|
|
|
|
}
|
2016-05-09 17:04:56 +02:00
|
|
|
|
2017-07-03 19:17:49 +02:00
|
|
|
public autoComplete(text: string): Promise<Array<AutoCompleteItem>> {
|
|
|
|
return this._networkService.getJson<Array<AutoCompleteItem>>("/autocomplete/" + text);
|
2017-06-10 22:32:56 +02:00
|
|
|
}
|
2016-05-03 21:04:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
}
|