2016-07-31 8 views
3

저는 Polymer와 Firebase의 초보자입니다. 두 기술로 연습하고 있습니다. 응용 프로그램 인증을 위해 firebase-auth을 구현하려고하는데 "정의되지 않은"signInWithPopup '속성을 읽을 수 없습니다.Polymer Firebase : Uncaught TypeError : 정의되지 않은 'signInWithPopup'속성을 읽을 수 없습니다.

이 코드가 있습니다

<paper-toolbar> 
    <span class="title">Sample!</span> 
    <paper-icon-button 
    icon="[[statusIcon(signedIn)]]" 
    on-tap="processAuth"> 
    </paper-icon-button> 
</paper-toolbar> 
<firebase-auth 
    id="auth" 
    app-name="emotions" 
    provider="google" 
    signed-in="{{signedIn}}" 
    user="{{user}}"> 
</firebase-auth> 

및 processAuth

processAuth: function() { 
    this.$.auth.signInWithPopup(); 
} 

의 스크립트를 다음과 같은 구성 요소가 이미 가져온 :

<link rel="import" href="../../bower_components/polymerfire/polymerfire.html"> 
<link rel="import" href="../../bower_components/polymerfire/firebase-auth.html"> 

내가 뭔가를 놓친나요?

죄송합니다. 매우 멍청한 질문입니다.

+0

를 사용하기 전에 같은 app-name으로 firebase-app을 초기화되어 있는지 확인이. $. auth'는 정의되지 않습니다. Polymer 요소의'template' 태그 안에'paper-toolbar'와'firebase-auth' 태그가 있습니까? 사용중인 메서드는 Polymer 요소에 중첩 된 요소에 액세스하는 올바른 방법입니다. – anthony

+0

"firebase-auth.html"은 이미 "polymerfire.html"에 가져 왔습니다. 다시 가져올 필요가 없습니다. – Mohammed

답변

3

당신이 오류가`당신을 말하고있다 firebase-auth

+0

어떻게 할 수 있습니까? – RuNpiXelruN

-2

this.$.auth 대신 document.getElementById('auth')을 사용해보세요.

this.$.auth은 안에있는 #auth을 찾으려고 시도하는 것 같습니다. 을 processAuth에서 확인하여 this이 가리키는 곳을 확인하십시오.

+0

'document.getElementById ('auth')'는 Polymer 요소 외부의 항목에 액세스하기위한 것입니다. – anthony

관련 문제