當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Http.get方法代碼示例

本文整理匯總了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);
 }
開發者ID:nguyenquan263,項目名稱:SMS_System_Final,代碼行數:6,代碼來源:vnclass-service.service.ts

示例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); }); 
 }
開發者ID:sandy100,項目名稱:Coursera,代碼行數:5,代碼來源:promotion.service.ts

示例3: getItems

	getItems() {
		return this.http.get('http://localhost/service/126').map(res => res.json());
	}
開發者ID:templth,項目名稱:mockbackend-test,代碼行數:3,代碼來源:nanadal.ts

示例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'));
 }
開發者ID:candyYMMA,項目名稱:skycoin,代碼行數:6,代碼來源:pending.transaction.service.ts

示例5: getData

 private getData(data_url): Promise<any> {
   return this.http.get(data_url)
     .toPromise()
     .then(this.extractData)
     .catch(this.handleError);
 }
開發者ID:ObsidianCat,項目名稱:time_travel_vacation,代碼行數:6,代碼來源:book-data-handler.service.ts

示例6: getProductByID

 getProductByID(productID: string): Observable<any>{
     return this.http.get(`/products/${productID}`)
         .map(res => res.json());
  }
開發者ID:AviFix,項目名稱:angular2typescript,代碼行數:4,代碼來源:product-service.ts

示例7: getPermission

 public getPermission(): Promise<IUserPermissions> {
     return this.http.get('Manager/Api/UserPermissions')
         .toPromise()
         .then((response) => response.json() as IUserPermissions)
         .catch(this.handleError);
 }
開發者ID:PjMitchell,項目名稱:ConfigServer,代碼行數:6,代碼來源:userpermission-data.service.ts

示例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));
 }
開發者ID:int32bit,項目名稱:harbor,代碼行數:6,代碼來源:user.service.ts

示例9:

const bazList = (http: Http) =>
    http.get('/data/bazData.json').map(res => res.json()).toPromise();
開發者ID:jeffmccommas,項目名稱:quickstart-ng2,代碼行數:2,代碼來源:baz.states.ts

示例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);
 }
開發者ID:cassilup,項目名稱:angular2workshop,代碼行數:5,代碼來源:base-client.service.ts


注:本文中的@angular/http.Http.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。