本文整理汇总了TypeScript中ionic-angular.LoadingController.present方法的典型用法代码示例。如果您正苦于以下问题:TypeScript LoadingController.present方法的具体用法?TypeScript LoadingController.present怎么用?TypeScript LoadingController.present使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ionic-angular.LoadingController
的用法示例。
在下文中一共展示了LoadingController.present方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: ionViewDidEnter
ionViewDidEnter() {
let loading = this.loading.create({
content: 'Loading items...'
});
loading.present();
setTimeout(() => {
for (let i = 0; i < 30; i++) {
this.items.push({ name: 'ionic' });
}
loading.dismiss();
}, 3000);
}
示例2: loadUsers
loadUsers() {
let loading = this.loading.create({});
loading.present().then(() => {
this.userService.getAll()
.then(users => {
this.users = users;
loading.dismiss();
}, (error) => {
this.users = [];
loading.dismiss();
});
});
}
示例3: loadPhotos
loadPhotos() {
let loading = this.loading.create({});
loading.present().then(() => {
this.photoService.getAll(this.album.id)
.then(photos => {
loading.dismiss();
this.photos = photos;
}, (error) => {
loading.dismiss();
this.photos = [];
});
});
}
示例4:
handler: data => {
console.log('Saved clicked');
let loading = this.loadCtrl.create({
content: "Getting songs..."
});
loading.present().then(() => {
this.musicService.getFirstTracks(data.term).then((tracks) => {
this.songs = tracks;
loading.dismiss();
});
});
}
示例5: login
/** If already registered then login using the following function. Check firebase and login */
login() {
/** Show Loading till they login */
let loading = this.loading.create({
content: 'Please Wait..'
});
loading.present();
/** check authentication from provider */
this.auth.loginWithEmail(this.form).subscribe(response => {
console.log(response);
loading.dismiss();
})
}
示例6: play
private play(id: string, songName: string, duration: number): void {
this.initSong.play();
setTimeout(() => {
this.initSong.pause();
},50)
let loading = this.loadCtrl.create({
content: "Buffering..."
});
loading.present().then(() => {
this.load(id, songName, duration).then((song) => {
console.log(song);
song.play();
setTimeout(() => {
loading.dismiss();
}, 700)
})
});
}
示例7: setTimeout
setTimeout(() => {
this.musicService.init();
this.loggedIn = false;
let loading = this.loadCtrl.create({
content: "Getting songs..."
});
loading.present().then(() => {
localforage.getItem("defaultSearch").then((value) => {
if (value === null) {
this.musicService.getFirstTracks("Tame Impala").then((tracks) => {
this.songs = tracks;
console.log(tracks);
SC.stream(`/tracks/${tracks[0].id}`).then((player) => {
this.initSong = player;
})
loading.dismiss();
})
}
else {
this.musicService.getFirstTracks(value).then((tracks) => {
console.log(tracks);
SC.stream(`/tracks/${tracks[0].id}`).then((player) => {
this.initSong = player;
})
this.songs = tracks;
loading.dismiss();
})
}
})
});
this.toastOpen = false;
}, 500)
示例8: doLogin
doLogin() {
let loading = this.loading.create({ content: "Iniciando Sesiรณn", duration: 10000 });
loading.present();
this.api.doLogin().then((data: any) => {
if (!data.email) {
let alert = this.alert.create({
title: 'Error ' + data.status,
subTitle: data._body,
buttons: ['OK']
});
loading.dismiss();
alert.present();
return;
}
this.api.setData(this.api.data.username, this.api.data.password, this.api.data.url);
this.api.user = data;
this.api.saveUser(data);
loading.dismiss();
this.navCtrl.setRoot(Page1);
}).catch((err) => {
console.log(err);
this.alert.create({ message: "Error al iniciar Session", buttons: ["OK"] }).present();
});
};