本文整理汇总了TypeScript中@angular/http.Http类的典型用法代码示例。如果您正苦于以下问题:TypeScript Http类的具体用法?TypeScript Http怎么用?TypeScript Http使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Http类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
resolveFn: (http: Http) =>
http.get('/data/bazData.json').map(res => res.json()).toPromise()
示例2: getResults
getResults(collegeId) {
return this.http.get('http://gcDashboardService:9000/collegeinfo/' + collegeId).map(res => res.json());
}
示例3: getSingleTeacherF
getSingleTeacherF(id){
return this.http.get('http://localhost:3000/get-teacher/'+id)
.map(res => res.json());
}
示例4:
getSchedule() : Observable<ScheduleData[]> {
return this.http.get('../railrunnerschedule.json').map(this.extractData).catch(this.handleError);
}
示例5: getConferenceById
getConferenceById(id: number): Observable<Conference> {
return this.http.get(this.constants.conferenceApi + '/' + id, this.httpHelperService.getAuthRequestOptionsArg())
.map(this.extractConferenceData)
.catch(this.handleConferenceError);
}
示例6: get
/**
* Returns an Observable for the HTTP GET request for the JSON resource.
* @return {string[]} The Observable for the HTTP request.
*/
get(): Observable<string[]> {
return this.http.get(`${Config.API}/api/name-list/static`)
.map((res: Response) => res.json())
.catch(this.handleError);
}
示例7: getAll
getAll(): void {
this.http.get(this.configuration.config.rootUrl + "api/persons").subscribe(
(result: Response) => {
this.contacts.next(result.json());
}, this.handleError);
}
示例8:
searchBooks(queryTitle: string): Observable<BookModel[]> {
return this.http.get(`${this.API_PATH}?q=${queryTitle}`)
.map(res => res.json().items);
}
示例9: getGroupsOfUser
//Liefert alle Gruppen in denen der User Mitglied ist
getGroupsOfUser(userId:string){
return this.http.get(Path[0]+"/getgroupsofuser?uid=" +userId)
.map(res => res.json());
}
示例10: getSpecificGroup
//Liefert Gruppe mit spezieller Id
getSpecificGroup(groupId:string) {
return this.http.get(Path[0]+"/getspecificgroup?gid=" +groupId)
.map(res => res.json());
}