当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript HttpClient.get方法代码示例

本文整理汇总了TypeScript中aurelia-http-client.HttpClient.get方法的典型用法代码示例。如果您正苦于以下问题:TypeScript HttpClient.get方法的具体用法?TypeScript HttpClient.get怎么用?TypeScript HttpClient.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在aurelia-http-client.HttpClient的用法示例。


在下文中一共展示了HttpClient.get方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: activate

 activate(params: any) {
     return this.http.get(`/api/schedulers/${params.schedulerName}/jobs/history`).then(response => {
         let model = response.content;
         this.entries = model.historyEntries;
         this.errorMessage = model.errorMessage;
     });
 }
开发者ID:Indifer,项目名称:quartznet,代码行数:7,代码来源:history.ts

示例2: activate

 activate(params: any) {
   var teamId = params.id;
   
   return this.httpClient.get('./team/'+teamId)
     .then(response => {
       this.team = new TeamViewModel(response.content);
     });
   
 }
开发者ID:richardnagle,项目名称:buildjs,代码行数:9,代码来源:team.ts

示例3: nameChanged

 nameChanged(newValue) {
     if (newValue.length > 0) {
         this.httpClient.get('/hello/' + newValue).then((response) => {
             this.result = response.content.Result;
         });
     } else {
         this.result = '';
     }
 }
开发者ID:KevinHoward,项目名称:ServiceStackVS,代码行数:9,代码来源:hello.ts

示例4: getAllUsers

  getAllUsers() {
    return this.http.get('https://api.nice.social/user/nicesummary')
      .then((response: any) => {
        return response.content.data;

      }).catch((err: any) => {
        this.ea.publish(new ApiStatus('Nice.Social API Issue', { status: 'error' }));
        return 'berg';
      });
  }
开发者ID:mttmccb,项目名称:dark_social,代码行数:10,代码来源:adn-api.ts

示例5: getRandomUserId

  getRandomUserId() {
    return this.http.get('https://api.nice.social/user/nicesummary')
      .then((response: any) => {
        var randomIndex = randomInteger(response.content.data.length);
        return response.content.data[randomIndex].user_id;

      }).catch((err: any) => {
        this.ea.publish(new ApiStatus('Nice.Social API Issue', { status: 'error' }));
        return 'berg';
      });
  }
开发者ID:mttmccb,项目名称:dark_social,代码行数:11,代码来源:adn-api.ts

示例6: ApiStatus

      .then(() => {
        this.isRequesting = true;
        return this.http.get(this.urlBuilder('lastposts', { id: this.state.tokenReturned.user.id, count: 1 })).then((response: any) => {
          this.isRequesting = false;
          this.ea.publish(new ApiStatus('Retrieved Last Post', { status: 'success' }));
          return response.content.data;

        }).catch((err: any) => {
          this.isRequesting = false;
          this.ea.publish(new ApiStatus('Unable to retrieve last post', { status: 'error' }));
          return nouser.data;
        });
      });
开发者ID:mttmccb,项目名称:dark_social,代码行数:13,代码来源:adn-api.ts

示例7: activate

 activate() {
   return this.httpClient.get('./team')
     .then(response => {
       
       var teamsJson = response.content;
       
       this.teams = new Array(teamsJson.length); 
       
       for (var i=0; i < teamsJson.length; i++) {
         this.teams[i] = new TeamViewModel(teamsJson[i]);
       }
     });
 } 
开发者ID:richardnagle,项目名称:buildjs,代码行数:13,代码来源:welcome.ts

示例8: getRandomUserId

  getRandomUserId() {
    this.isRequesting = true;

    return this.http.get('user/nicesummary')
      .then((response: any) => {
        this.isRequesting = false;
        return response.content.data[randomInteger(response.content.data.length)].name;

      }).catch((err: any) => {
        console.log("Nice.Social API Issue");
        this.isRequesting = false;
        return 'berg';
      });
  }
开发者ID:mttmccb,项目名称:dark_social,代码行数:14,代码来源:nice-api.ts

示例9: loadProfile

  loadProfile(id: number, more: boolean) {
    this.isRequesting = true;

    return this.http.get(this.urlBuilder('users', { id: id, more: more }))
      .then((response: any) => {
        this.isRequesting = false;
        this.ea.publish(new ApiStatus('Retrieved Profile', { status: 'success' }));
        return response.content.data;

      }).catch((err: any) => {
        this.isRequesting = false;
        this.ea.publish(new ApiStatus('Username not found, restoring known user', { status: 'error' }));
        return nouser.data;
      });
  }
开发者ID:mttmccb,项目名称:dark_social,代码行数:15,代码来源:adn-api.ts

示例10: load

  load(url: string, params: any) {
    this.isRequesting = true;

    return this.http.get(this.urlBuilder(url, params))
      .then((response: any) => {
        this.meta = response.content.meta;
        this.isRequesting = false;
        this.ea.publish(new ApiStatus(`Retrieved ${url}`, { status: 'success' }));
        return response.content.data;

      }).catch((err: any) => {
        this.isRequesting = false;
        this.ea.publish(new ApiStatus(`Unable to load ${url}`, { status: 'success' }));
        return {};
      });
  }
开发者ID:mttmccb,项目名称:dark_social,代码行数:16,代码来源:adn-api.ts


注:本文中的aurelia-http-client.HttpClient.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。