Skip to content

this.masonry is undefined #1

@dmcgrandle

Description

@dmcgrandle

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions