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


TypeScript Jsonp.get方法代碼示例

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


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

示例1: searchRx

  searchRx (term: string) {
   var search = new URLSearchParams()
   search.set('action', 'opensearch');
   search.set('search', term);
   search.set('format', 'json');
   return this.jsonp
               .get('http://en.wikipedia.org/w/api.php?callback=JSONP_CALLBACK', { search })
               .map((response) => response.json()[1]);
               
                               
 }
開發者ID:ranjitjc,項目名稱:ts-rxjs-angular2,代碼行數:11,代碼來源:wikipedia-service.ts

示例2: search

 search(): any {
     var search = new URLSearchParams();
     //search.set('action', 'opensearch');
     //search.set('search', term);
     //search.set('format', 'json');
     //return this.jsonp.get('./showcase/portlet/data.json', { search}).map((request) => request.json()[1]);
     let url = './showcase/portlet/setting.json';            
     return this.jsonp
         .get(url, {})
         .map(request => this.result(request));
 }
開發者ID:racktime,項目名稱:glucosensWebApp,代碼行數:11,代碼來源:portletService.ts

示例3: search

 search(term: string){
     
     let search = new URLSearchParams();
     search.set('action', 'opensearch');
     search.set('search', term);
     search.set('format', 'json');
     
     return this.jsonp.get('http://en.wikipedia.org/w/api.php?callback=JSONP_CALLBACK', {search})
                      .toPromise()
                      .then((res) => res.json()[1]);
 }
開發者ID:dilunika,項目名稱:angular2,代碼行數:11,代碼來源:promise.wiki.service.ts

示例4: rawSearch

    rawSearch(searchParam:string) {
        console.log('HeroService:wikiSearch ', searchParam);

        let search:URLSearchParams = new URLSearchParams();
        search.set('action', 'opensearch');
        search.set('search', searchParam);
        search.set('format', 'json');

        return this.jsonp.get('http://en.wikipedia.org/w/api.php?callback=JSONP_CALLBACK', {search})
            .map((res) => res.json()[1]);
    }
開發者ID:jesussobrino,項目名稱:angular2-heroes,代碼行數:11,代碼來源:hero.service.ts

示例5: search

  search(term: string) {
    let wikiSearchUrl = 'http://en.wikipedia.org/w/api.php';

    var searchParams = new URLSearchParams();
    searchParams.set('action', 'opensearch');
    searchParams.set('search', term);
    searchParams.set('format', 'json');
    searchParams.set('callback', 'JSONP_CALLBACK');

    return this.jsonp
      .get(wikiSearchUrl, {search: searchParams})
      .map((request) => request.json()[1]);
  }
開發者ID:huguogang,項目名稱:Web,代碼行數:13,代碼來源:wiki_observable.service.ts

示例6: method

 method(name, params = {}) {
   return this._jsonp
       .get(`${API_URL}${name}?${this.getParams(params)}`)
       .map(res => res.json())
       .filter(res => {
         if (res.response) {
           return res;
         } else {
           this._errService.pushError(res.error.error_msg);
           if (res.error && res.error.error_code == 6) {
             return res;
           }
         }
       })
 }
開發者ID:igorivaniuk,項目名稱:vk-post-commentators,代碼行數:15,代碼來源:vk-api.service.ts

示例7: search

  search(term: String) {
    let wikiSearchUrl = 'http://en.wikipedia.org/w/api.php';

    var searchParams = new URLSearchParams();
    searchParams.set('action', 'opensearch');
    searchParams.set('search', term);
    searchParams.set('format', 'json');
    searchParams.set('callback', 'JSONP_CALLBACK');

    return this.jsonp
      .get(wikiSearchUrl, {search: searchParams})
      .toPromise()
      //.then((response) => console.log(response.json()[1])); 
      .then((response) => response.json()[1]);
  }
開發者ID:huguogang,項目名稱:Web,代碼行數:15,代碼來源:wiki_promise.service.ts

示例8: constructor

 constructor(jsonp: Jsonp) {
   jsonp.get('./people.json?callback=JSONP_CALLBACK').subscribe(res => this.people = res.json());
 }
開發者ID:hankduan,項目名稱:angular,代碼行數:3,代碼來源:jsonp_comp.ts

示例9: displaySubreddit

 private displaySubreddit(subreddit: string) {
     this.feedData = this.jsonp.get("http://reddit.com/r/aww.json?jsonp=JSONP_CALLBACK")
         .map(response => (response.json() as ApiResponse).data.children)
         .map(submissions => submissions.map(val => val.data));
 }
開發者ID:bowdenk7,項目名稱:ReactDemo,代碼行數:5,代碼來源:main.ts

示例10: displaySubreddit

 private displaySubreddit(subreddit: string) {
     this.feedData = this.jsonp
         .get("http://reddit.com/r/aww.json?jsonp=JSONP_CALLBACK")
         .map(res => (res.json() as ApiResponse).data.children.map(child => child.data));
 }
開發者ID:HansS,項目名稱:typescript-build2016-demos-anders-hejlsberg,代碼行數:5,代碼來源:main.ts


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