2016-05-03 21:04:57 +02:00
|
|
|
///<reference path="../../../browser.d.ts"/>
|
|
|
|
|
2016-05-04 17:20:21 +02:00
|
|
|
import {Injectable} from "@angular/core";
|
|
|
|
import {Http} from "@angular/http";
|
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";
|
|
|
|
import {Message} from "../../../../common/entities/Message";
|
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
|
|
|
|
|
|
|
|
2016-05-05 17:51:51 +02:00
|
|
|
constructor(private _networkService:NetworkService){
|
2016-05-03 21:04:57 +02:00
|
|
|
}
|
2016-05-04 18:34:54 +02:00
|
|
|
|
2016-05-04 18:57:31 +02:00
|
|
|
public autoComplete(text:string): Promise<Message<Array<AutoCompleteItem> >> {
|
2016-05-05 17:51:51 +02:00
|
|
|
return this._networkService.getJson("/gallery/autocomplete/"+text);
|
2016-05-03 21:04:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|