2016-09-02 2 views
5

angular2-meteor을 사용하여 Meteor v1.4Angular2 rc-5을 기반으로 앱을 만들고 있습니다. 지금까지는 괜찮 았지만 Firebase 데이터베이스와 통합해야하지만 아래 예외가 있습니다 (Chrome에서 앱을 실행 중입니다). 내 모든 타이프 스크립트가 괜찮아 보이고 오류가 발생하지 않는 것 같습니다. 유성 앱이 정상적으로로드됩니다. 설치 4 단계가 끝날 때까지 설치 및 설정 안내서를 따랐습니다. (그러나 유성을 사용하고 있기 때문에 각도를 사용하지 않았습니다. -cli를 사용하여 프로젝트를 만들 수 있습니다.), 어떤 생각을 고칠 수 있습니까? 감사Angularfire2 : "location.protocol"은 http 또는 https 여야합니다 (유성 앱)

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";