本文整理匯總了TypeScript中ionic-angular.LoadingController.create方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript LoadingController.create方法的具體用法?TypeScript LoadingController.create怎麽用?TypeScript LoadingController.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ionic-angular.LoadingController
的用法示例。
在下文中一共展示了LoadingController.create方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
constructor(public platform: Platform, public navCtrl: NavController, public user:User, public push: Push, public navParams: NavParams, storage: Storage, public af: AngularFire, public loadingCtrl:LoadingController) {
// CARICA TUTTE LE GARE NEL DATABASE
let loader = this.loadingCtrl.create({
content: "Attendere il caricamento delle gare..."
});
loader.present();
this.gare = af.database.object('/gare', { preserveSnapshot: true });
this.gare.subscribe(snapshot => {
storage.set('gareDB', snapshot.val());
this.navCtrl.setRoot(Page1)
});
this.gare.subscribe(() => loader.dismissAll());
if (this.platform.is('android')) {
this.push.register().then((t: PushToken) => {
return this.push.saveToken(t);
}).then((t: PushToken) => {
this.notificheSnap = this.af.database.object('/utenti/'+this.user.id+'/notifiche/', { preserveSnapshot: true });
this.notificheSnap.set({pushToken:t.token});
});
}
}
示例2: loginProject
loginProject() {
let loader = this.loadingCtrl.create({
content: "登錄中..."
});
loader.present();
if (this.platform.is('android')) {
HNBridge.loginProject(() => {
loader.dismiss();
HNBridge.gotoPage("project-main");
}, () => {
}, this.commonHttpService.accountInfo.account, this.commonHttpService.accountInfo.password);
} else {
this.projectService.login().subscribe(info => {
loader.dismiss();
this.platform.ready().then(() => {
HNBridge.setAccountId(info.accountId, parseInt(info.roleId) === 9);
HNBridge.gotoPage("project-main");
this.projectService.startGetLocation();
});
}, error => {
loader.dismiss();
});
}
}
示例3: 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);
});
*/
}
示例4: uploadPhoto
async uploadPhoto(imageFileUri: any): Promise<void> {
this.myPhoto = imageFileUri;
this.error = null;
this.loading = this.loadingCtrl.create({
content: 'Uploading...'
});
await this.loading.present();
const fileTransfer: FileTransferObject = this.transfer.create();
const fileEntry = await this.file.resolveLocalFilesystemUrl(imageFileUri);
const options: FileUploadOptions = {
fileKey: 'file',
fileName: fileEntry.name,
headers: {}
};
try {
const result = await fileTransfer.upload(imageFileUri, 'http://192.168.178.84:8080/upload', options);
console.log(result.bytesSent);
console.log(result.responseCode);
this.showToast(true);
}
catch (e) {
console.log(e);
this.showToast(false);
}
finally {
this.loading.dismiss();
}
}
示例5: presentLoading
presentLoading() {
this.loadingCtrl.create({
content: 'Please wait...',
duration: 3000,
dismissOnPageChange: true
}).present();
}
示例6: cargarDetalle
private cargarDetalle(vendedor: string, anno: number, mes: number,
incluirAlbaranes: boolean, etiqueta: string) {
let loading: any = this.loadingCtrl.create({
content: 'Cargando Comisiones...',
});
loading.present();
this.servicio.cargarDetalle(vendedor, anno, mes, incluirAlbaranes, etiqueta)
.subscribe(
data => {
if (data.length === 0) {
let alert = this.alertCtrl.create({
title: 'Error',
subTitle: 'No se han cargado correctamente las comisiones',
buttons: ['Ok'],
});
alert.present();
} else {
this.listaDetalleComision = data;
}
},
error => {
loading.dismiss();
},
() => {
loading.dismiss();
}
)
}
示例7: toggleVoid
toggleVoid() {
const voidText = 'Are you sure you want to void this transaction? It will re-stock the items listed in the invoice.';
const unvoidText = 'Are you sure you want to un-void this transaction? It will again deduct the items listed in the invoice.';
const loading = this.loadingCtrl.create({
content: 'Please wait...'
});
const confirm = this.alertCtrl.create({
title: `${this.invoice.isVoided ? 'Un-void' : 'Void'} Invoice?`,
message: this.invoice.isVoided ? unvoidText : voidText,
buttons: [
{
text: 'Cancel'
},
{
text: 'Confirm',
handler: () => {
loading.present();
this.ivService
.toggleVoid(this.invoice)
.toPromise()
.then(res => {
this.invoice.isVoided = res.isVoided;
loading.dismiss();
});
}
}
]
});
confirm.present();
}
示例8: showLoading
showLoading() {
let loading = this.loadingCtrl.create({
content: 'Loading...',
duration: 3000
});
loading.present();
}
示例9: fetchNews
//TODO FIX TWICE BUTTON CLICK
fetchNews(date){
var loader = this.loadingCtrl.create({
content: "Loading news...",
});
loader.present().then(()=> {
console.log("fetchNews");
var y = date.getFullYear();
var m = ("0" + (date.getMonth() + 1)).slice(-2);
var d = ("0" + date.getDate()).slice(-2);
this.http.get("http://apollo_ror.slapps.fr/news.json?date="+y+m+d).map(res => res.json()).subscribe(data => {
this.news = [];
console.log(data);
for(var i=0;i<data.length;i++){
this.news.push({
title: data[i].title,
source: data[i].source,
image_link: data[i].image_link,
datetime:new Date(data[i].date),
link:data[i].link
});
};
this.updateNews();
loader.dismiss();
});
});
}
示例10: signInWithEmail
signInWithEmail() {
const loading = this.loadingCtrl.create({
content: 'Por favor, aguarde...'
});
loading.present();
this.auth.signInWithEmailAndPassword(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 = 'Insira um email válido.';
break;
case 'auth/wrong-password':
this.errorMessage = 'Combinação de usuário e senha incorreta.';
break;
case 'auth/user-not-found':
this.errorMessage = 'Combinação de usuário e senha incorreta.';
break;
default:
this.errorMessage = error;
break;
}
this.hasError = true;
});
}
示例11: 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();
}
});
}
示例12: uploadFile
uploadFile() {
let loader = this.loadingCtrl.create({
content: "Uploading..."
});
loader.present();
const fileTransfer: FileTransferObject = this.transfer.create();
let options: FileUploadOptions = {
fileKey: 'ionicfile',
fileName: 'ionicfile',
chunkedMode: false,
mimeType: "image/jpeg",
headers: {}
}
fileTransfer.upload(this.imageURI, 'http://192.168.0.7:8080/api/uploadImage', options)
.then((data) => {
console.log(data+" Uploaded Successfully");
this.imageFileName = "http://192.168.0.7:8080/static/images/ionicfile.jpg"
loader.dismiss();
this.presentToast("Image uploaded successfully");
}, (err) => {
console.log(err);
loader.dismiss();
this.presentToast(err);
});
}
示例13: getCurrentLocation
getCurrentLocation(): Observable<google.maps.LatLng> {
let loading = this.loadingCtrl.create({
content: 'Locating...'
});
loading.present(loading);
let options = {timeout: 10000, enableHighAccuracy: true};
let locationObs = Observable.create(observable => {
Geolocation.getCurrentPosition(options)
.then(resp => {
let lat = resp.coords.latitude;
let lng = resp.coords.longitude;
let location = new google.maps.LatLng(lat, lng);
console.log('Geolocation: ' + location);
observable.next(location);
loading.dismiss();
},
(err) => {
console.log('Geolocation err: ' + err);
loading.dismiss();
})
})
return locationObs;
}
示例14: signInWithEmail
signInWithEmail() {
const loading = this.loadingCtrl.create({
content: 'Please wait...'
});
loading.present();
this.auth.signInWithEmailAndPassword(this.form.value.email, this.form.value.password)
.then((data) => {
console.log("uid",data.uid);
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/wrong-password':
this.errorMessage = 'Incorrect username and password combination.';
break;
case 'auth/user-not-found':
this.errorMessage = 'user not found Contcat suppor team';
break;
default:
this.errorMessage = error;
break;
}
this.hasError = true;
});
}
示例15: signInWithEmail
signInWithEmail() {
const loading = this.loadingCtrl.create({
content: 'Por favor, aguarde...'
});
loading.present();
this.auth.sendPasswordResetEmail(this.form.value.email).then(() => {
loading.dismiss();
this.hasError = false;
this.emailSent = true;
}, (error) => {
loading.dismiss();
switch (error.code) {
case 'auth/invalid-email':
this.errorMessage = 'Insira um email válido.';
break;
case 'auth/user-not-found':
this.errorMessage = 'Nenhum usuário com este email encontrado.';
break;
default:
this.errorMessage = error;
break;
}
this.hasError = true;
});
}