2016-06-04 3 views
1

폴리머 앱을 쓰려고합니다.스크립트의 폴리머 호출 함수

onLogin에서 updateItems를 호출하는 동안 아래 코드에서 문제가 발생합니다.

기능을 인식하지 못합니다.

내가 어떻게 updateItems라는 전화를 너무

Polymer({ 

    is: 'my-view1', 

    updateItems : function(snapshot) {...}, 
    onLogin : function(user) { 
     this.ref = ... ; 
     this.ref.on('value', function(snapshot) { 
      updateItems(snapshot); 
    }); 
    }, 
}); 

어떤 제안을 this.updateItems을 시도했다.

감사합니다.

답변

0

스토어 같은 this에 대한 참조 :

updateItems : function(snapshot) {...}, 
    onLogin : function(user) { 
     var self = this. 
     this.ref = ... ; 
     this.ref.on('value', function(snapshot) { 
      self.updateItems(snapshot); 
    }); 
    },