2017-06-21 7 views
0

hltv-api npmパッケージをhltv-apiフォルダに直接インストールしました。 私はファイルを私のcomponent.tsでそれをインポートしようとしました:それはSRCからindex.jsを引っ張るために奇妙だAngular2 - hltv-apiを追加した後にトレースが見つかりませんでした。npm



    /** 
    * System configuration for Angular samples 
    * Adjust as necessary for your application needs. 
    */ 
    (function (global) { 
     System.config({ 
     paths: { 
      // paths serve as alias 
      'npm:': 'node_modules/' 
     }, 
     // map tells the System loader where to look for things 
     map: { 
      // our app is within the app folder 
      app: 'app', 
      // angular bundles 
      '@angular/core': 'npm:@angular/core/bundles/core.umd.js', 
      '@angular/common': 'npm:@angular/common/bundles/common.umd.js', 
      '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', 
      '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', 
      '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', 
      '@angular/http': 'npm:@angular/http/bundles/http.umd.js', 
      '@angular/router': 'npm:@angular/router/bundles/router.umd.js', 
      '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', 
      // other libraries 
      'rxjs':      'npm:rxjs', 
      'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js' 
      'hltv-api' : 'npm:hltv-api' 
     }, 
     // packages tells the System loader how to load when no filename and/or no extension 
     packages: { 
      app: { 
      main: './main.js', 
      defaultExtension: 'js' 
      }, 
      rxjs: { 
      defaultExtension: 'js' 
      }, 
      'hltv-api': { 
      main: './src/index.js', 
      defaultExtension: 'js' 
      } 
     } 
     }); 
    })(this); 



    import { 
     getNews, 
     getResults 
    } from 'hltv-api'; 

そして、私のsystemjs.config.jsは以下のようにファイルを作っしかし、npmのインストール後、私はそれらのフォルダしか持っていません。誰もこれで私を助けることができますか?これを答えるのはかなり遅くなってごめんなさい

おかげ

答えて

0

が、それはまだ便利です願っています。

Hltv-apiはnode.jsモジュールです。ノードでAPIを提供する必要があります。 hltvはスクレイピングシステムに影響するWebサイトを更新しているため、元のrepoを更新しました。最新バージョンまたはモジュールを使用して作業する必要があります。今から(v1.2.1)、sample appでは、単純なサーバーを作成してAPIを提供する方法がわかります。私はドキュメンテーションに取り組むだけでなく、別の機能でAPIを拡張しようとしています。

今のところ問題を開いたり、Github's repoで何かを提案したり質問したりしてください。

関連する問題