wittlock/ngx-image-zoom

Angular 9 shared module import

Closed this issue · 4 comments

If you import NgxImageZoomModule in shared module, the console show error that BrowserModule is imported twice or more.

Console error
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.

I think that it happened because ngx-image-zoom import BrowserModule...

File: ngx-image-zoom.module.d.ts
...
import * as ɵngcc2 from '@angular/platform-browser';
export declare class NgxImageZoomModule {
static ɵmod: ɵngcc0.ɵɵNgModuleDefWithMeta<NgxImageZoomModule, [typeof ɵngcc1.NgxImageZoomComponent], [typeof ɵngcc2.BrowserModule], [typeof ɵngcc1.NgxImageZoomComponent]>;
...
}

Should be fixed in 0.5.1

Yes, this was fixed in 0.5.1 thanks to a quick pull request from @sNohz :)
I'll leave this open for a bit so others can see it as well.

I have problem with ngx-image-zoom@0.6.0 and angular 9.x.
Description:
Zooming on image is working when NgxImageZoomModule is imported in app.module.ts but not working when I try import it in shared.module and try use it in some shared component, console is empty and I can see image in zoom box. Can you help me please? tnx

Closing this issue as resolved. @bjelajac93 if you are still having an issue in 1.0.1 of this library, please open a new issue with some example code (better late than never, right?)