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


TypeScript HttpClient.get方法代碼示例

本文整理匯總了TypeScript中@angular/common/http.HttpClient.get方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript HttpClient.get方法的具體用法?TypeScript HttpClient.get怎麽用?TypeScript HttpClient.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@angular/common/http.HttpClient的用法示例。


在下文中一共展示了HttpClient.get方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getEmployees

 /*
 * EMPLEADOS
 */
 getEmployees() {
   return this.http.get(this.api + 'employees', { observe: 'response' });
 }
開發者ID:av2sf,項目名稱:facturaya,代碼行數:6,代碼來源:api.service.ts

示例2: fetchNavigationInfo

 /**
  * Get an observable that fetches the `NavigationResponse` from the server.
  * We create an observable by calling `http.get` but then publish it to share the result
  * among multiple subscribers, without triggering new requests.
  * We use `publishLast` because once the http request is complete the request observable completes.
  * If you use `publish` here then the completed request observable will cause the subscribed observables to complete too.
  * We `connect` to the published observable to trigger the request immediately.
  * We could use `.refCount` here but then if the subscribers went from 1 -> 0 -> 1 then you would get
  * another request to the server.
  * We are not storing the subscription from connecting as we do not expect this service to be destroyed.
  */
 private fetchNavigationInfo(): Observable<NavigationResponse> {
   const navigationInfo = this.http.get<NavigationResponse>(navigationPath)
     .pipe(publishLast());
   (navigationInfo as ConnectableObservable<NavigationResponse>).connect();
   return navigationInfo;
 }
開發者ID:BobChao87,項目名稱:angular,代碼行數:17,代碼來源:navigation.service.ts

示例3: getScript

 getScript(scriptId: number) {
   return this.http.get<Script>(`${InteractiveExplorerConfig.API_URL}/scripts/${scriptId}`);
 }
開發者ID:our-city-app,項目名稱:plugin-interactive-explorer,代碼行數:3,代碼來源:scripts.service.ts

示例4: checkUser

 checkUser(): Observable<UserInfo> {
     return this.http.get<UserInfoResponse>('/raw/auth/check?format=json').pipe(
         map(resp => AuthService.statusCheck(resp)));
 }
開發者ID:EBIBioStudies,項目名稱:BioStudyUISub,代碼行數:4,代碼來源:auth.service.ts

示例5: getMyLikes

    public getMyLikes (): Observable<IPagedResult<ITrack>> {
        const url = `${this._audioZoneService.getCurrentZoneSnapshot().path}/api/likes/mylikes?start=0&take=50`;

        return this._http.get<IPagedResult<ITrack>>(url);
    }
開發者ID:Lightw3ight,項目名稱:PlayMeExtension,代碼行數:5,代碼來源:queue.service.ts

示例6: getMobilePlanById

  getMobilePlanById(id: number): Observable<MobilePlan> {

    return this.service.get<MobilePlan>('http://localhost:3000/mobilePlans/' + id);
   }
開發者ID:vatsank,項目名稱:NgTelecom,代碼行數:4,代碼來源:plan.service.ts

示例7: findAll

 findAll(page: number, count: number) {
   return this.http.get(`${LUF_API}/escalas/${page}/${count}`);
 }
開發者ID:alexalvesdesouza,項目名稱:front_end_projects,代碼行數:3,代碼來源:escala.service.ts

示例8: runReportTests

 runReportTests():Observable<any>{
   // return this.http.get("http://localhost:3000/Project2/Servlet/ProtractorTests"); // local
   return this.http.get("http://54.174.104.191:8080/Project2/Servlet/ReportTests");
 }
開發者ID:icavanaugh95,項目名稱:project2,代碼行數:4,代碼來源:requests.service.ts

示例9: runManageBatch

 runManageBatch():Observable<any>{
   return this.http.get("http://54.174.104.191:8080/Project2/Servlet/ManageBatch");
 }
開發者ID:icavanaugh95,項目名稱:project2,代碼行數:3,代碼來源:requests.service.ts

示例10: getSomething

 getSomething():Observable<any>{
   return this.http.get("http://54.174.104.191:8080/Project2/Servlet/getSomething");
 }
開發者ID:icavanaugh95,項目名稱:project2,代碼行數:3,代碼來源:requests.service.ts


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