angular2-image-gallery
angular2-image-gallery copied to clipboard
Issue lazy loading module
This library does not work when trying to use it in lazy-loaded modules, due to the fact that the library imports "BrowserAnimationsModule". An angular library should not import this module.
This library (with the current module imports) cannot be used in lazily-loaded modules and cannot be used with server-side render (Angular Universal). I suggest removing the "BrowserAnimationsModule" import. Also, I see the "FormsModule" being imported, but I did not see it being used? Perhaps the "FormsModule" import can be removed too? Would you accept a PR if I made this change?
I'm suggesting changing:
@NgModule({
imports: [
CommonModule,
FormsModule,
HttpClientModule,
BrowserAnimationsModule
],
To:
@NgModule({
imports: [
CommonModule,
HttpClientModule
],
This may be related to issue #32 but I couldn't find a PR for the issue.
Let me know your thoughts.
Thanks,
Yes, would love to merge a PR on this topic.
Please do me a favor and test the integration in default projects without lazy loading before submitting the PR. I will do so as well when I find some time but this will save roundtrips.
yes! i agree with @rustygreen. How can i remove BrowserAnimationsModule?
I have similar error when uses it on lazy loaded module
Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.
This should be fixed with the new 14 release.