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