Skip to content

Commit

Permalink
feat(package): added the alert service to push some notification on t…
Browse files Browse the repository at this point in the history
…he UI
  • Loading branch information
AnthonyNahas committed Aug 3, 2018
1 parent 7aef0c6 commit aab6d3c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/auth/module/services/alert.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { TestBed, inject } from '@angular/core/testing';

import { AlertService } from './alert.service';

describe('AlertServiceService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [AlertService]
});
});

it('should be created', inject([AlertService], (service: AlertService) => {
expect(service).toBeTruthy();
}));
});
15 changes: 15 additions & 0 deletions src/auth/module/services/alert.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {EventEmitter, Injectable} from '@angular/core';
import {IAlert} from '../../..';

@Injectable()
export class AlertService {

alerts: Array<IAlert> = [];
onNewAlert: EventEmitter<IAlert> = new EventEmitter<IAlert>();


constructor() {
this.onNewAlert.subscribe((alert: IAlert) => this.alerts.push(alert)
);
}
}

0 comments on commit aab6d3c

Please sign in to comment.