Skip to content

Fix #10: Spread operator in useValue of provider doesn't work when us…#12

Open
jantilburgh wants to merge 2 commits intosyncrea:masterfrom
jantilburgh:bugfix/aot-config
Open

Fix #10: Spread operator in useValue of provider doesn't work when us…#12
jantilburgh wants to merge 2 commits intosyncrea:masterfrom
jantilburgh:bugfix/aot-config

Conversation

@jantilburgh
Copy link

@jantilburgh jantilburgh commented Feb 18, 2018

This PR fixes #10 where the STORE_FORMS_CONFIG will be null when using AOT. Also removed the providers from the NgModule definition since the forRoot & forFeature convention is used.

provide: _STORE_FORMS_CONFIG,
useValue: config
}, {
provide: STORE_FORMS_CONFIG,
Copy link
Member

@gionkunz gionkunz Feb 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems weird... Isn't there any other more elegant solution for this problem?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I know of, for example it's not possible to return a function expression in a decorator. Also checked other libraries and it looks like that they're using the same approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AOT compatibility

2 participants