Skip to content

Commit aab6d3c

Browse files
committed
feat(package): added the alert service to push some notification on the UI
1 parent 7aef0c6 commit aab6d3c

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { TestBed, inject } from '@angular/core/testing';
2+
3+
import { AlertService } from './alert.service';
4+
5+
describe('AlertServiceService', () => {
6+
beforeEach(() => {
7+
TestBed.configureTestingModule({
8+
providers: [AlertService]
9+
});
10+
});
11+
12+
it('should be created', inject([AlertService], (service: AlertService) => {
13+
expect(service).toBeTruthy();
14+
}));
15+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import {EventEmitter, Injectable} from '@angular/core';
2+
import {IAlert} from '../../..';
3+
4+
@Injectable()
5+
export class AlertService {
6+
7+
alerts: Array<IAlert> = [];
8+
onNewAlert: EventEmitter<IAlert> = new EventEmitter<IAlert>();
9+
10+
11+
constructor() {
12+
this.onNewAlert.subscribe((alert: IAlert) => this.alerts.push(alert)
13+
);
14+
}
15+
}

0 commit comments

Comments
 (0)