0
Mein Code ist dies:Drucken String AngularJS 2 ionischer 2
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
var user1 = firebase.auth().currentUser;
var name, email, photoUrl, password, uid, emailVerified;
if (user != null) {
name = user1.displayName;
email = user1.email;
photoUrl = user1.photoURL;
emailVerified = user1.emailVerified;
uid = user1.uid; // The user's ID, unique to the Firebase project. Do NOT use
// this value to authenticate with your backend server, if
// you have one. Use User.getToken() instead.
console.log(email);
}
} else {
console.log('no user');
}
});
console.log (E-Mail) druckt mir die E-Mail aber in html
<h1>email: {{ email }}</h1>
drucke nicht mir nichts, warum? Ich habe gegoogelt aber nichts. Was ist los mit dir?
Sie sollten 'anstelle von' var' let'. Finden Sie eine Erklärung hier in der wunderbaren [Typoskript-Dokumentation] [1] [1]: https://www.typescriptlang.org/docs/handbook/variable-declarations.html – niklas
@niklas Sie haben Recht..danke. Aber nicht wirklich der Grund, warum OP das Problem bekommt –
Ich erkläre es email: any; Ich habe dies getan.email = user1.email aber nichts. Konsolenprotokolldruck: [email protected], aber {{email}} nothing –