From 279e7178ee6f24ed44336459e4cbcbdd1a020b01 Mon Sep 17 00:00:00 2001 From: Art Date: Fri, 17 Sep 2021 14:54:47 +0300 Subject: [PATCH] 130. Creating notification service (#16) --- .../src/app/service/notification.service.spec.ts | 16 ++++++++++++++++ .../src/app/service/notification.service.ts | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 support-portal-frontend/src/app/service/notification.service.spec.ts create mode 100644 support-portal-frontend/src/app/service/notification.service.ts diff --git a/support-portal-frontend/src/app/service/notification.service.spec.ts b/support-portal-frontend/src/app/service/notification.service.spec.ts new file mode 100644 index 0000000..899735a --- /dev/null +++ b/support-portal-frontend/src/app/service/notification.service.spec.ts @@ -0,0 +1,16 @@ +import {TestBed} from '@angular/core/testing'; + +import {NotificationService} from './notification.service'; + +describe('NotificationService', () => { + let service: NotificationService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(NotificationService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/support-portal-frontend/src/app/service/notification.service.ts b/support-portal-frontend/src/app/service/notification.service.ts new file mode 100644 index 0000000..986497c --- /dev/null +++ b/support-portal-frontend/src/app/service/notification.service.ts @@ -0,0 +1,16 @@ +import {Injectable} from '@angular/core'; +import {NotifierService} from "angular-notifier"; + +@Injectable({ + providedIn: 'root' +}) +export class NotificationService { + + constructor(private notifier: NotifierService) { + } + + public notify(type: string, message: string): void { + this.notifier.notify(type, message); + } + +}