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

this.masonry is undefined #1

Open
dmcgrandle opened this issue Mar 8, 2019 · 0 comments
Open

this.masonry is undefined #1

dmcgrandle opened this issue Mar 8, 2019 · 0 comments

Comments

@dmcgrandle
Copy link

getting an error attempting to use this module. Apparently the provider injection is not working.

Here is a snip from photo.module.ts:

import { Masonry, MasonryModule } from '@thisissoon/angular-masonry';
import { SharedModule } from '../shared/shared.module';
import { PhotoRoutingModule } from './photo-routing.module'; 
import { AlbumsComponent } from './albums/albums.component';
import { PhotosComponent } from './photos/photos.component';

const masonryProviders = [
    { provide: Masonry, useFactory: () => window['Masonry'] }
];

@NgModule({
    imports: [
        CommonModule,
        PhotoRoutingModule,
        SharedModule,
        MasonryModule.forRoot(masonryProviders),
    ],

Here is the error in the browser on use:

ERROR TypeError: _this.masonry is not a constructor

Here is a console.log('masonry is:', masonry) from inside the component:

masonry: undefined

Thanks for any help.
:D

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