本文整理汇总了TypeScript中angularfire2.FirebaseAuth.createUser方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FirebaseAuth.createUser方法的具体用法?TypeScript FirebaseAuth.createUser怎么用?TypeScript FirebaseAuth.createUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angularfire2.FirebaseAuth
的用法示例。
在下文中一共展示了FirebaseAuth.createUser方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: registerUser
/**
* this create in the user using the form credentials.
*
* we are preventing the default behavor of submitting
* the form
*
* @param _credentials {Object} the email and password from the form
* @param _event {Object} the event information from the form submit
*/
registerUser(_credentials, _event) {
_event.preventDefault();
this.auth.createUser(_credentials).then((value) => {
console.log(value)
this.dismiss()
}).catch((error) => {
this.error = error
console.log(error)
});
}
示例2: registerUser
registerUser(email:string, password:string):Promise<any>{
return this.auth.createUser({
email: email,
password: password
})
.then(() => this.auth.login({
email: email,
password: password
}))
.then(user => Promise.resolve( user ))
.catch(error => Promise.reject( error ));
}
示例3: Promise
return new Promise((resolve, reject) => {
this.auth.createUser(credentials)
.then((authData) => {
this.authData = authData;
resolve(this.authData);
})
.catch((error) => {
reject(error);
});
});
示例4: signup
signup(_credentials) {
this.auth.createUser(_credentials)
.then((authData) => {
console.log(authData);
_credentials.created = true;
return this.createUser(_credentials);
})
.catch((error) => {
this.error = error
console.log(error)
});
}
示例5: registerUser
/**
* this create in the user using the form credentials.
*
* we are preventing the default behavor of submitting
* the form
*
* @param _credentials {Object} the email and password from the form
* @param _event {Object} the event information from the form submit
*/
registerUser(_credentials, _event) {
_event.preventDefault();
this.auth.createUser(_credentials).then((authData) => {
console.log(authData)
_credentials.created = true;
return this.login(_credentials, _event);
}).catch((error) => {
this.error = error
console.log(error)
});
}
示例6: registerUser
private registerUser(credentials) {
this.showLoading();
this.auth.createUser(credentials).then((authData) => {
this.loading.dismiss();
let prompt = Alert.create({
title: 'Sucesso',
subTitle: 'Sua conta foi criada!',
buttons: ['OK']
});
this.nav.present(prompt);
}).catch((error) => {
this.showError(error);
});
}
示例7: registerUser
public registerUser(credentials){
this.showLoading();
this.auth.createUser(credentials).then((authData) =>{
this.loading.dismiss();
let prompt = Alert.create({
title: 'Success',
subTitle: 'Your new Account was created!',
buttons: ['OK']
});
this.nav.present(prompt);
}).catch((error) => {
this.showError(error)
});
}
示例8: signUp
signUp() {
if(this.doPasswordsMatch()) {
var creds: any = {email: this.registerEmail, password: this.registerPassword};
this._auth.createUser(creds)
.then((success) => {
this.error = false;
success.auth.sendEmailVerification(); // working!
this.addItem(event);
this.clear();
})
.catch((error) => {
this.displayError("Firebase failure: " + error);
});
}
else {
this.displayError("Passwords do not match.");
}
}