我正在用angular2-meteor开发一个基于Meteor v1.4和Angular2 rc-5的应用程序。到目前为止还好,但我需要将它与我的Firebase数据库集成,但我得到了下面的例外(我正在运行Chrome上的应用程序)。看来我所有的打字稿都没问题,我没有任何错误,我的Meteor应用程序通常加载,我遵循教程ofInstallation和设置直到第4步结束。(然而,由于我使用的是流星,我没有使用角-cli创建项目),知道如何解决这个问题吗?谢谢
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发布于 2016-09-10 02:42:28
您只需要将location.protocol设置为'http‘或'https'即可。您可以通过向类中添加以下提供程序来实现这一点。
providers: [{
provide: WindowLocation, useValue: {
protocol: 'https' // Change to HTTP if you prefer.
}
}]不要忘记通过编写以下内容导入WindowLocation:
import {WindowLocation} from "angularfire2";https://stackoverflow.com/questions/39295935
复制相似问题