diff --git a/src/notification.component.ts b/src/notification.component.ts index a277897..e468bbc 100644 --- a/src/notification.component.ts +++ b/src/notification.component.ts @@ -236,8 +236,8 @@ export class NotificationComponent implements OnInit, OnDestroy { return this.position !== 0 ? this.position * 90 : 0; } - onClick($e: any): void { - this.item.click.emit($e); + onClick($e: MouseEvent): void { + this.item.click!.emit($e); if (this.clickToClose) { this.remove(); diff --git a/src/notifications.service.ts b/src/notifications.service.ts index bc275ea..5cdafb4 100644 --- a/src/notifications.service.ts +++ b/src/notifications.service.ts @@ -55,7 +55,7 @@ export class NotificationsService { // HTML Notification method html(html: any, type: string, override?: any) { - return this.set({html: html, type: type, icon: 'bare', override: override, title: null, content: null}, true); + return this.set({html: html, type: type, icon: 'bare', override: override}, true); } // Remove all notifications method @@ -64,4 +64,4 @@ export class NotificationsService { else this.emitter.next({command: 'cleanAll'}); } -} \ No newline at end of file +} diff --git a/src/simple-notifications.component.ts b/src/simple-notifications.component.ts index 06fece5..1423529 100644 --- a/src/simple-notifications.component.ts +++ b/src/simple-notifications.component.ts @@ -90,11 +90,11 @@ export class SimpleNotificationsComponent implements OnInit, OnDestroy { break; case 'clean': - this.cleanSingle(item.id); + this.cleanSingle(item.id!); break; case 'set': - if (item.add) this.add(item.notification); + if (item.add) this.add(item.notification!); else this.defaultBehavior(item); break; diff --git a/tests/spec/notifications.service.spec.ts b/tests/spec/notifications.service.spec.ts index e510eee..8329883 100644 --- a/tests/spec/notifications.service.spec.ts +++ b/tests/spec/notifications.service.spec.ts @@ -206,8 +206,8 @@ describe('NotificationsService', () => { expect(notification.type).toBe('success'); expect(notification.icon).toBe('bare'); - expect(notification.title).toBeNull(); - expect(notification.content).toBeNull(); + expect(notification.title).toBeUndefined(); + expect(notification.content).toBeUndefined(); expect(notification.override).toBeUndefined(); expect(notification.html).toBe('Title'); expect(notification.state).toBeUndefined(); @@ -239,4 +239,4 @@ describe('NotificationsService', () => { }) ); -}); \ No newline at end of file +});