Created
February 25, 2019 18:53
-
-
Save Sampath-Lokuge/7f476ae67ea09166d2057572b42d7b5c to your computer and use it in GitHub Desktop.
loading
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { LoadingController } from '@ionic/angular'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class LoadingService { | |
constructor(private loadingCtrl: LoadingController) { } | |
async presentLoader(): Promise<HTMLIonLoadingElement> { | |
const loader = await this.loadingCtrl.create({ | |
cssClass: 'transparent', | |
}); | |
loader.present(); | |
return loader; | |
} | |
dismissLoader(loader: HTMLIonLoadingElement): Promise<boolean> { | |
if (loader) { return loader.dismiss(); } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment