Skip to content

Commit e5ed9bb

Browse files
authored
fix(aot): Fixed Angular AoT compilation issue
- Fixed Angular AoT issue when compiling (resolving symbol values statically) - Improved overall AoT compability - Extended npmignore file Closes #7
1 parent 7898f66 commit e5ed9bb

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
# Build: Temp folder
1414
/temp
1515

16-
# Demo
16+
# Demo & docs
1717
/demo
18+
/docs
1819

1920
# Not needed files
2021
/tools

src/components/notifier-container.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ import { NotifierNotificationComponent } from './notifier-notification.component
3232
} )
3333
export class NotifierContainerComponent implements OnDestroy, OnInit {
3434

35+
/**
36+
* List of currently somewhat active notifications
37+
*/
38+
public notifications: Array<NotifierNotification>;
39+
3540
/**
3641
* Change detector
3742
*/
@@ -47,11 +52,6 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
4752
*/
4853
private readonly config: NotifierConfig;
4954

50-
/**
51-
* List of currently somewhat active notifications
52-
*/
53-
private notifications: Array<NotifierNotification>;
54-
5555
/**
5656
* Queue service observable subscription (saved for cleanup)
5757
*/

src/components/notifier-notification.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ export class NotifierNotificationComponent implements AfterViewInit {
5151
@Output()
5252
public dismiss: EventEmitter<string>;
5353

54+
/**
55+
* Notifier configuration
56+
*/
57+
public readonly config: NotifierConfig;
58+
5459
/**
5560
* Notifier timer service
5661
*/
@@ -66,11 +71,6 @@ export class NotifierNotificationComponent implements AfterViewInit {
6671
*/
6772
private readonly renderer: Renderer;
6873

69-
/**
70-
* Notifier configuration
71-
*/
72-
private readonly config: NotifierConfig;
73-
7474
// tslint:disable no-any
7575
/**
7676
* Native element reference, used for manipulating DOM properties

src/models/notifier-config.model.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,19 @@ export class NotifierConfig implements NotifierOptions {
108108
*/
109109
public theme: string;
110110

111+
// tslint:disable no-any
111112
/**
112113
* Constructor
113114
*
114-
* @param {NotifierOptions} [customOptions={}] Custom notifier options, optional
115+
* Note:
116+
* As for now, Angular cannot handle interface declarations in constructors of injectable classes. This issue got fixed, however only
117+
* for Angular 4+. Therefore, we use the 'any' type temporarily. For further details, see
118+
* - the issue on <https://github.com/angular/angular/issues/12631> as well as
119+
* - the fix on <https://github.com/angular/angular/pull/14894>.
120+
*
121+
* @param {any} [customOptions={}] Custom notifier options, optional
115122
*/
116-
public constructor( customOptions: NotifierOptions = {} ) {
123+
public constructor( customOptions: any = {} ) {
117124

118125
// Set default values
119126
this.animations = {
@@ -191,5 +198,6 @@ export class NotifierConfig implements NotifierOptions {
191198
}
192199

193200
}
201+
// tslint:enable no-any
194202

195203
}

0 commit comments

Comments
 (0)