angularjs-styleguide icon indicating copy to clipboard operation
angularjs-styleguide copied to clipboard

class constructors must be invoked with |new|

Open fstodulski opened this issue 7 years ago • 1 comments

Hello. I have a problem with my component's code.

I use this styleguid to build my app. export const SidebarComponent = { templateUrl: '../app/components/common/sidebar/sidebar.component.html', controller: class SidebarComponentController { constructor() { } $onInit() { this.list = [] } } }

It works on Chrome and Safari but on Firefox it throws me an error: class constructors must be invoked with |new|

I there any way to fix it ?

fstodulski avatar May 08 '17 12:05 fstodulski

@Kamieniu just put this on the end of the controller class : SidebarComponentController.$$ngIsClass = true;

hadicahyadi avatar May 23 '17 03:05 hadicahyadi