masonry is not a constructor
Hi, i got error with using masonry with angular 2.0 release. The problem is in masonry.ts on line 60:
this._msnry = new masonry(this._element.nativeElement, this.options);
Error message from console:
EXCEPTION: Error in /angular/views/app.html:13:11 caused by: masonry is not a constructor
ORIGINAL EXCEPTION: masonry is not a constructor
TypeError: masonry is not a constructor
at AngularMasonry.ngOnInit (masonry.ts:60)
at DebugAppView._View_ChatComponent0.detectChangesInternal (ChatComponent.ngfactory.js:145)
at DebugAppView.AppView.detectChanges (core.umd.js:9566)
at DebugAppView.detectChanges (core.umd.js:9671)
at DebugAppView.AppView.detectViewChildrenChanges (core.umd.js:9592)
at DebugAppView._View_ChatComponent_Host0.detectChangesInternal (ChatComponent_Host.ngfactory.js:36)
at DebugAppView.AppView.detectChanges (core.umd.js:9566)
at DebugAppView.detectChanges (core.umd.js:9671)
at ViewRef_.detectChanges (core.umd.js:7668)
at eval (core.umd.js:7089)
in my app.html:
<masonry>
<masonry-brick class="brick" *ngFor="let post of posts">
<!--<post [post]="post">Component loading...</post>-->
</masonry-brick>
</masonry>
Is it bug or what is wrong? Tranks
What module loader-system are you using? I've tried it with both systemjs and webpack without problem.
@jelgblad Systemjs, but i finally used only masonry lib and it works well.
@petrck OK. Getting ES5-libraries load in typescript with both webpack and systemjs isn't as straight forward as one might think.
This error says that masonry-layout isn't loaded into the masonry-variable properly:
EXCEPTION: Error in /angular/views/app.html:13:11 caused by: masonry is not a constructor
ORIGINAL EXCEPTION: masonry is not a constructor
I'm still interested if this issue is with systemjs or with this library. Can you paste your systemjs-configuration?
@petrck can you please list your solution? I'm getting the same issue when trying to run tests through Jasmine and Karma and am at my wits end.