本文整理汇总了TypeScript中ionic-angular.Loading类的典型用法代码示例。如果您正苦于以下问题:TypeScript Loading类的具体用法?TypeScript Loading怎么用?TypeScript Loading使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Loading类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: loginUser
loginUser(){
if (!this.loginForm.valid){
console.log(this.loginForm.value);
} else {
this.authData.loginUser(this.loginForm.value.email, this.loginForm.value.password).then( authData => {
this.nav.setRoot(HomePage);
}, error => {
let alert = Alert.create({
message: error.message,
buttons: [
{
text: "Ok",
role: 'cancel'
}
]
});
this.nav.present(alert);
});
let loading = Loading.create({
dismissOnPageChange: true,
});
this.nav.present(loading);
}
}
示例2: presentLoadingDefault
presentLoadingDefault() {
this.loading = Loading.create({
content: 'Please wait...'
});
this.navCtrl.present(this.loading);
}
示例3: hideLoading
public hideLoading(): Promise<any> {
return (this.loading && this.loading.dismiss().then(() => {
this.loading = null;
})) || new Promise((resolve, reject) => resolve({})).then(() => {
this.loading = null;
});
}
示例4: validateLoginCode
validateLoginCode() {
let loading = Loading.create({
content: "正在查找...",
});
this.nav.present(loading);
this.loginService.validateLoginCode(this.loginCode)
.then(data => {
this.response = data;
if(this.response.hash){
this.firstName = this.response.first_name;
this.lastName = this.response.last_name;
this.loginCodeCorrect = true;
this.config.set('HASH', this.response.hash);
this.local.set('HASH', this.response.hash);
} else {
this.firstName = "";
this.lastName = "";
this.codeIncorrect('密码错误', '请确认后重试');
this.loginCodeCorrect = false;
}
this.isHandling = false;
loading.dismiss();
});
}
示例5: register
register(email, password){
let loading = Loading.create({
content: 'Criando usuário...' ,
dismissOnPageChange: true
});
this._navController.present(loading);
var $this = this;
this.angularFire.auth.createUser({
email: email,
password: password
}).then(function(userData){
loading.dismiss();
$this._viewController.dismiss();
}, function(error){
loading.dismiss();
console.error('Erro', error);
let alert = Alert.create({
title: 'Ops :(',
subTitle: 'Não consegui te cadastrar, tente mais tarde !',
buttons: ['OK']
});
$this._navController.present(alert);
});
}
示例6: startLoading
startLoading(loadingCtrl: LoadingController)
{
this.loading = loadingCtrl.create({
content: '请稍候...'
});
this.isLoading = true;
this.loading.present();
}
示例7:
.catch ( (err: AuthError) => {
console.log(err);
this.analytics.trackEvent('Login', 'Submit', 'Failed');
this.loading.dismiss().then( () => {
if (err) {
if (err.message === 'passwordExpired') {
this.updatePassword(user.value.email, user.value.password)
.then(() => {
console.log('UpdatePassword resolved');
this.navCtrl.setRoot('HomePage');
})
.catch(() => {
console.log('UpdatePassword rejected');
});
return;
}
const alert = this.alertCtrl.create({
message: this.translateService.instant(err.message),
buttons: [
{
text: 'Ok',
role: 'cancel'
}
]
});
alert.present();
}
});
});
示例8: loginUser
loginUser(){
if (!this.loginForm.valid){
console.log(this.loginForm.value);
} else {
this.authData.loginUser(this.loginForm.value.email, this.loginForm.value.password)
.then( authData => {
this.navCtrl.setRoot(HomePage);
}, error => {
this.loading.dismiss().then( () => {
let alert = this.alertCtrl.create({
message: error.message,
buttons: [
{
text: "אישור",
role: 'ביטול'
}
]
});
alert.present();
});
});
this.loading = this.loadingCtrl.create({
dismissOnPageChange: true,
});
this.loading.present();
}
}
示例9: if
this.events.subscribe('wordpress:savestatus', (state) => {
console.log(state);
if (state.state === 'saving') {
this.loader.present();
console.log('saving');
}
else if (state.state === 'error') {
this.loader.dismiss();
this.createLoader();
this.toastCtrl.create({ message: 'Error Saving Report', duration: 3000 }).present();
}
else if (state.state === 'finished') {
this.loader.dismiss();
this.createLoader();
console.log('finished');
}
});