1
저는 데이터베이스로 Firebase v3를 사용하는 이온 2 앱에서 작업하고 있습니다. 내 기능은 이미 작동하지만, 나는 그것이 나에게이 오류주는 무슨 잘못 사용자에게 간단한 경고를 표시하려고하면 다음 null의 'alertCtrl'속성을 읽을 수 없습니다.
Cannot read property 'alertCtrl' of null
내 함수의 :
updateUniqueCode(uniqueCode: string): any {
this.userProfile.on("child_added", function(snapshot,prevChildKey){
let allUniqueCodes = snapshot.val();
if (allUniqueCodes.uniqueCode === uniqueCode){
let alert = this.alertCtrl.create({
message: "no",
buttons: [{ text: "Ok"} ]
});
alert.present();
} else {
let currentUser = firebase.auth().currentUser;
let userProfile = firebase.database().ref('/userProfile');
return userProfile.child(currentUser.uid).update({
uniqueCode:uniqueCode
})
}
});
}
내가 많이 시도했습니다를 다른 솔루션으로,하지만 아무것도 미리 :( 감사를 작동하는 것 같다되지
Thankss을 사용하고 있다는 것입니다! 그것은 지금 일한다! !! :디 –