mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
styled toggle button and Added alert service
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AlertService } from './alert.service';
|
||||
|
||||
describe('AlertService', () => {
|
||||
let service: AlertService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(AlertService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AlertService {
|
||||
|
||||
constructor(public alertController: AlertController) { }
|
||||
|
||||
async presentAlert(message:string) {
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Mensagem do sistema',
|
||||
message: message,
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user