Skip to content

Commit 540cda5

Browse files
authored
Merge pull request #131 from cjc343/master
Fix TypeScript 2.0 type checking issues
2 parents 0dd88d4 + e1d6950 commit 540cda5

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/notification.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ export class NotificationComponent implements OnInit, OnDestroy {
236236
return this.position !== 0 ? this.position * 90 : 0;
237237
}
238238

239-
onClick($e: any): void {
240-
this.item.click.emit($e);
239+
onClick($e: MouseEvent): void {
240+
this.item.click!.emit($e);
241241

242242
if (this.clickToClose) {
243243
this.remove();

src/notifications.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class NotificationsService {
5555

5656
// HTML Notification method
5757
html(html: any, type: string, override?: any) {
58-
return this.set({html: html, type: type, icon: 'bare', override: override, title: null, content: null}, true);
58+
return this.set({html: html, type: type, icon: 'bare', override: override}, true);
5959
}
6060

6161
// Remove all notifications method
@@ -64,4 +64,4 @@ export class NotificationsService {
6464
else this.emitter.next({command: 'cleanAll'});
6565
}
6666

67-
}
67+
}

src/simple-notifications.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ export class SimpleNotificationsComponent implements OnInit, OnDestroy {
9090
break;
9191

9292
case 'clean':
93-
this.cleanSingle(item.id);
93+
this.cleanSingle(item.id!);
9494
break;
9595

9696
case 'set':
97-
if (item.add) this.add(item.notification);
97+
if (item.add) this.add(item.notification!);
9898
else this.defaultBehavior(item);
9999
break;
100100

tests/spec/notifications.service.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ describe('NotificationsService', () => {
206206
expect(notification.type).toBe('success');
207207
expect(notification.icon).toBe('bare');
208208

209-
expect(notification.title).toBeNull();
210-
expect(notification.content).toBeNull();
209+
expect(notification.title).toBeUndefined();
210+
expect(notification.content).toBeUndefined();
211211
expect(notification.override).toBeUndefined();
212212
expect(notification.html).toBe('<B>Title</B>');
213213
expect(notification.state).toBeUndefined();
@@ -239,4 +239,4 @@ describe('NotificationsService', () => {
239239
})
240240
);
241241

242-
});
242+
});

0 commit comments

Comments
 (0)