Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngx-lightbox not working with Angular 7 #33

Closed
imrahulmpawar opened this issue Aug 11, 2019 · 2 comments
Closed

ngx-lightbox not working with Angular 7 #33

imrahulmpawar opened this issue Aug 11, 2019 · 2 comments

Comments

@imrahulmpawar
Copy link

Hi,
I installed ngx-lightbox as per the instruction listed here.
also,Included the style css line in angular.jon.

Then setup the project as mentioned here.

Now in my custom component class following line fails :

export class LightboxComponent
{
  _albums: Array;
  constructor(private _lightbox: Lightbox) <====
  {

Coz nothing gets rendered on chrome and i get following error on console :

Uncaught Error: Can't resolve all parameters for Lightbox: ([object Object], [object Object], [object Object], [object Object], [object Object], ?).
at syntaxError (compiler.js:2175)
at CompileMetadataResolver._getDependenciesMetadata (compiler.js:19986)
at CompileMetadataResolver._getTypeMetadata (compiler.js:19882)
at CompileMetadataResolver._getInjectableTypeMetadata (compiler.js:20099)
at CompileMetadataResolver.getProviderMetadata (compiler.js:20108)
at compiler.js:20046
at Array.forEach ()
at CompileMetadataResolver._getProvidersMetadata (compiler.js:20006)
at CompileMetadataResolver.getNgModuleMetadata (compiler.js:19734)
at CompileMetadataResolver.getNgModuleSummary (compiler.js:19569)

Kindly help resolve this.

@imrahulmpawar
Copy link
Author

Is this below code missing a "@Injectable" ?

@Injectable <==== ?
export declare class Lightbox {
    private _componentFactoryResolver;
    private _injector;
    private _applicationRef;
    private _lightboxConfig;
    private _lightboxEvent;
    private _documentRef;
    constructor(_componentFactoryResolver: ComponentFactoryResolver, _injector: Injector, _applicationRef: ApplicationRef, _lightboxConfig: LightboxConfig, _lightboxEvent: LightboxEvent, _documentRef: any);
    open(album: Array, curIndex?: number, options?: {}): void;
    close(): void;
    _createComponent(ComponentClass: any): ComponentRef;
}

@imrahulmpawar
Copy link
Author

This got resolved !
Not sure how/why but i did following :

npm install [email protected]

even though the installation page said to use [email protected] for angular 7 as mentioned here.

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

No branches or pull requests

1 participant