mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
37 lines
885 B
TypeScript
37 lines
885 B
TypeScript
|
|
import { Injectable } from '@angular/core';
|
||
|
|
import { LoadingController } from '@ionic/angular';
|
||
|
|
|
||
|
|
@Injectable({
|
||
|
|
providedIn: 'root'
|
||
|
|
})
|
||
|
|
export class LoadingService {
|
||
|
|
|
||
|
|
constructor(public loadingController: LoadingController) { }
|
||
|
|
|
||
|
|
async simpleLoading(message:string) {
|
||
|
|
const loading = await this.loadingController.create({
|
||
|
|
cssClass: 'my-custom-class',
|
||
|
|
message:message,
|
||
|
|
duration: 2000
|
||
|
|
});
|
||
|
|
await loading.present();
|
||
|
|
|
||
|
|
const { role, data } = await loading.onDidDismiss();
|
||
|
|
}
|
||
|
|
|
||
|
|
async customizedLoading() {
|
||
|
|
const loading = await this.loadingController.create({
|
||
|
|
cssClass: 'my-custom-class',
|
||
|
|
spinner: null,
|
||
|
|
duration: 5000,
|
||
|
|
message: 'Click the backdrop to dismiss early...',
|
||
|
|
translucent: true,
|
||
|
|
backdropDismiss: true
|
||
|
|
});
|
||
|
|
await loading.present();
|
||
|
|
|
||
|
|
const { role, data } = await loading.onDidDismiss();
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|