本文整理汇总了TypeScript中ionic-angular.Loading.dismiss方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Loading.dismiss方法的具体用法?TypeScript Loading.dismiss怎么用?TypeScript Loading.dismiss使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ionic-angular.Loading
的用法示例。
在下文中一共展示了Loading.dismiss方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: checkAllLoaded
checkAllLoaded() {
if (this.areNeedsRetrieved && this.areResponsesRetrieved) {
this.mungedNeeds = this.needs
.map((n) => {
const responses = this.responses
.filter((r) => r.needId === n.id)
.map((r) => {
return {
...r,
formattedCreationDate: new Date(r.creationDate).toLocaleDateString(),
mailLink: `mailto:${r.email}?subject=Thanks for your offer to help with "${htmlDecode(n.description)}"`
}
})
return {
...n,
responses: responses,
hasResponses: responses.length > 0,
responsesLabel: responses.length === 1
? `${responses.length} response`
: `${responses.length} responses`
}
})
this.loader.dismiss()
}
}
示例2: 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();
}
}
示例3:
this.geolocation.getCurrentPosition().then((position) => {
let latLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
let mapOptions = {
center: latLng,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
this.map = new google.maps.Map(this.mapElement.nativeElement, mapOptions);
this.addMarkers();
this.addMyMarker();
/*let myMarker = new google.maps.Marker({
map: this.map,
animation: google.maps.Animation.DROP,
position: latLng,
});
let myContent = "IO";
this.addInfoWindow(myMarker, myContent);*/
this.loading.dismiss()
console.log('fine caricamento mappa')
}, (err) => {
示例4:
.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();
}
});
});
示例5: hideLoading
public hideLoading(): Promise<any> {
return (this.loading && this.loading.dismiss().then(() => {
this.loading = null;
})) || new Promise((resolve, reject) => resolve({})).then(() => {
this.loading = null;
});
}
示例6: resolve
.subscribe(data => {
// we've got back the raw data, now generate the core schedule data
// and save the data for later reference
//dismiss the loader and return response back.
this.loading.dismiss().then(() => resolve(data));
}, (error) => {
示例7: 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');
}
});
示例8: dismissLoading
//noinspection TypeScriptUnresolvedVariable
dismissLoading(): Promise<any> {
if(this.loading) {
return this.loading.dismiss().then(() => this.loading = null);
} else {
//noinspection TypeScriptUnresolvedFunction
return new Promise(func => func());
}
}
示例9:
(err)=>{
let alert = Alert.create({
title : "Couldn't get your info",
subTitle : "You can't continue right now, Try again later",
buttons:['Will check it out']
});
this.loading.dismiss();
this.nav.present(alert);
}