本文整理汇总了TypeScript中@angular/http.Http.get方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Http.get方法的具体用法?TypeScript Http.get怎么用?TypeScript Http.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/http.Http
的用法示例。
在下文中一共展示了Http.get方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getVNClassAvailable
getVNClassAvailable(studentCode:string, year: string, semester: string) {
return this.http.get(this.connectionLink.getConnection()+'/getVNclassAvailableREST/'+studentCode+'&'+year+'&'+semester,this.options)
.toPromise()
.then(res =>res.json())
.then(resJson => resJson);
}
示例2: getFeaturedPromotion
getFeaturedPromotion(): Observable<Promotion> {
return this.http.get(baseURL + 'promotions?featured=true')
.map(res => { return this.processHTTPMsgService.extractData (res)[0]; })
.catch(error => { return this.processHTTPMsgService .handleError(error); });
}
示例3: getItems
getItems() {
return this.http.get('http://localhost/service/126').map(res => res.json());
}
示例4: getPendingTransactions
getPendingTransactions(): Observable<PendingTxn[]> {
return this._http
.get('/pendingTxs', {headers: this.getHeaders()})
.map((res:Response) => res.json())
.catch((error:any) => Observable.throw(error.json().error || 'Server error'));
}
示例5: getData
private getData(data_url): Promise<any> {
return this.http.get(data_url)
.toPromise()
.then(this.extractData)
.catch(this.handleError);
}
示例6: getProductByID
getProductByID(productID: string): Observable<any>{
return this.http.get(`/products/${productID}`)
.map(res => res.json());
}
示例7: getPermission
public getPermission(): Promise<IUserPermissions> {
return this.http.get('Manager/Api/UserPermissions')
.toPromise()
.then((response) => response.json() as IUserPermissions)
.catch(this.handleError);
}
示例8: getUsers
//Get the user list
getUsers(): Promise<User[]> {
return this.http.get(userMgmtEndpoint, HTTP_GET_OPTIONS).toPromise()
.then(response => response.json() as User[])
.catch(error => this.handleError(error));
}
示例9:
const bazList = (http: Http) =>
http.get('/data/bazData.json').map(res => res.json()).toPromise();
示例10: get
public get(url:string):Observable<any> {
let headers = new Headers({ 'Accept': 'application/json' });
let options = new RequestOptions({ headers: headers });
return this.http.get(`${this.baseUrl}${url}`, options);
}