本文整理汇总了TypeScript中ionic-angular.LoadingController类的典型用法代码示例。如果您正苦于以下问题:TypeScript LoadingController类的具体用法?TypeScript LoadingController怎么用?TypeScript LoadingController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LoadingController类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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();
})
}
示例5:
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();
});
});
}
示例6: feedbackSubmit
feedbackSubmit(){
this.loading = this.loadingCtrl.create({
content: 'Please Wait...'
});
this.loading.present();
let data = { "subject":this.subject,"remarks":this.remarks, "user_id":this.user_id,"send_file":""}
console.log(data);
this.apiservice.feedback(data).then((result) => {
this.responseData = result;
if(this.responseData.status){
this.loading.dismiss();
let toast = this.toastCtrl.create({
message: 'Feedback Submitted Successfully',
duration: 5000,
position: 'top'
});
toast.present();
this.navCtrl.setRoot(this.navCtrl.getActive().component);
}else{
this.loading.dismiss();
let toast = this.toastCtrl.create({
message: 'Error! Please send feedback again.',
duration: 5000,
position: 'top'
});
toast.present();
}
});
}
示例7: ionViewLoaded
ionViewLoaded() {
console.log("Entro al catalogo");
let loading = this.loadingController.create({
content: "Obteniendo encuestas"
});
loading.present();
this.prizeList = this.surveyProvider.getPrizesObtained(this.userData);
loading.dismiss();
/*
.then((data) => {
this.catalog = <[Prize]>data;
loading.dismiss();
}, (err) => {
loading.dismiss();
let alert = this.alertCtrl.create({
title: 'Equipos Pregunta',
subTitle: 'Error al obtener encuestas',
buttons: [{
text: 'cancel',
role: 'canel'
}]
});
alert.present();
console.log(err);
});
*/
}
示例8: downloadAndInstall
private downloadAndInstall() {
const updating = this.loadingCtrl.create({
content: 'Updating application...'
});
updating.present();
this.deploy.download().then(() => this.deploy.extract()).then(() => this.deploy.load());
}
示例9: getContacts
getContacts(state: number) {
if (state == 0) {
let loading = this.loadingCtrl.create({
spinner: 'crescent',
content: this.lgnUsed.loader_config,
duration: 10000
});
loading.present();
}
Contacts.find(['phoneNumbers', 'displayName'], { multiple: true, hasPhoneNumber: true, desiredFields: ['phoneNumbers', 'displayName'] })
.then((contacts) => {
let contactsList;
contactsList = contacts;
this.setPermissionCache(true);
this.formatPhoneNumbers(contactsList);
},
(err) => {
if (err) {
console.log(err);
err >= 0 && err <= 20 ? this.setPermissionCache(false) : null;
}
});
}
示例10: signUp
signUp() {
const loading = this.loadingCtrl.create({
content: "We're creating a user for you ...."
});
loading.present();
this.auth.createUser(this.form.value.email, this.form.value.password).then(() => {
loading.dismiss();
this.navCtrl.setRoot('tabs');
}, (error) => {
loading.dismiss();
switch (error.code) {
case 'auth/invalid-email':
this.errorMessage = 'Please enter a valid email address.';
break;
case 'auth/weak-password':
this.errorMessage = 'The password must be at least 6 characters long.';
break;
case 'auth/email-already-in-use':
this.errorMessage = 'This email has already been used for another account.';
break;
default:
this.errorMessage = error;
break;
}
this.hasError = true;
});
}