mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
Added styles to Expediente Module
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { LoadingService } from './loading.service';
|
||||
|
||||
describe('LoadingService', () => {
|
||||
let service: LoadingService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(LoadingService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,38 @@
|
||||
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();
|
||||
console.log('Loading dismissed!');
|
||||
}
|
||||
|
||||
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();
|
||||
console.log('Loading dismissed with role:', role);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user