本文整理匯總了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());
}