2016-09-02 4 views
5

angular2-meteorのアプリをMeteor v1.4Angular2 rc-5に基づいて作成しています。これまでのところ大丈夫でしたが、私はFirebaseデータベースと統合する必要がありますが、私は以下の例外があります(私はChrome上でアプリケーションを実行しています)。それは私のtypescriptは問題ないと思われ、私は何のエラーも出ません。私のMeteorアプリケーションは正常に読み込まれます。ステップ4の最後までチュートリアルのインストールと設定に従いました。(しかし、Meteorを使っているので、 -cliを使ってプロジェクトを作成する)、これをどのように修正するか?おかげAngularfire2: "location.protocol"はhttpまたはhttps(Meteorアプリ)でなければなりません

EXCEPTION: Error: This operation is not supported in the environment this application is running on. 

"location.protocol" must be http or https and web storage must be enabled. 

BrowserDomAdapter.logError @ browser_adapter.js:84 
BrowserDomAdapter.logGroup @ browser_adapter.js:94 
ExceptionHandler.call @ exception_handler.js:65 
next @ application_ref.js:348 
schedulerFn @ async.js:89 
SafeSubscriber.__tryOrUnsub @ Subscriber.js:225 
SafeSubscriber.next @ Subscriber.js:174 
Subscriber._next @ Subscriber.js:124 
Subscriber.next @ Subscriber.js:88 
Subject._finalNext @ Subject.js:128 
Subject._next @ Subject.js:120 
Subject.next @ Subject.js:77 
EventEmitter.emit @ async.js:77 
onError @ ng_zone.js:124 
onHandleError @ ng_zone_impl.js:74 
ZoneDelegate.handleError @ zone.js:368 
Zone.runTask @ zone.js:297 
ZoneTask.invoke @ zone.js:464 

答えて

3

は、あなただけの 'HTTP' または 'https'にlocation.protocolを設定するを必要としています。クラスに次のプロバイダを追加することで、これを行うことができます。

providers: [{ 
    provide: WindowLocation, useValue: { 
     protocol: 'https' // Change to HTTP if you prefer. 
    } 
}] 

書き込みによってWindowLocationをインポートすることを忘れないでください:

import {WindowLocation} from "angularfire2"; 
関連する問題