当前位置: 首页>>代码示例>>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;未经允许,请勿转载。