Commit d3c5baa8 authored by Ratnadeep Rajendra Kharade's avatar Ratnadeep Rajendra Kharade
Browse files

created loading page service

parent dc1ec17a
import { TestBed } from '@angular/core/testing';
import { LoadingService } from './loading.service';
describe('LoadingService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: LoadingService = TestBed.get(LoadingService);
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
import { LoadingController } from '@ionic/angular';
@Injectable({
providedIn: 'root'
})
export class LoadingService {
loaderToShow: any;
constructor(
public loadingController: LoadingController
) {
}
showLoader(message = 'loading...') {
this.loaderToShow = this.loadingController.create({
message: message
}).then((res) => {
res.present();
res.onDidDismiss().then((dis) => {
console.log('Loading dismissed!');
});
});
}
hideLoader() {
this.loadingController.dismiss();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment