Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularfire2:“;地点.协议“;必须是http或https(Meteor应用程序)_Meteor_Angular_Firebase_Angularfire2_Angular2 Meteor - Fatal编程技术网

Angularfire2:“;地点.协议“;必须是http或https(Meteor应用程序)

Angularfire2:“;地点.协议“;必须是http或https(Meteor应用程序),meteor,angular,firebase,angularfire2,angular2-meteor,Meteor,Angular,Firebase,Angularfire2,Angular2 Meteor,我正在使用angular2 meteor基于meteor v1.4和angular2 rc-5制作一个应用程序。到目前为止一切正常,但我需要将它与我的Firebase数据库集成,但我得到以下例外(我在Chrome上运行该应用程序)。看来我所有的打字脚本都很好,我没有得到任何错误,我的Meteor应用程序加载正常,我一直遵循安装和设置教程,直到第4步结束。(但是因为我使用的是Meteor,所以我没有使用angular cli来创建项目),你知道如何解决这个问题吗?谢谢 EXCEPTION: Err

我正在使用
angular2 meteor
基于
meteor v1.4
angular2 rc-5
制作一个应用程序。到目前为止一切正常,但我需要将它与我的Firebase数据库集成,但我得到以下例外(我在Chrome上运行该应用程序)。看来我所有的打字脚本都很好,我没有得到任何错误,我的Meteor应用程序加载正常,我一直遵循安装和设置教程,直到第4步结束。(但是因为我使用的是Meteor,所以我没有使用angular 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

您只需将location.protocol设置为“http”或“https”。您可以通过向类中添加以下提供程序来实现这一点

providers: [{
    provide: WindowLocation, useValue: {
        protocol: 'https' // Change to HTTP if you prefer.
    }
}]
不要忘记通过写入以下内容导入WindowLocation:

import {WindowLocation} from "angularfire2";