toddmotto / angularjs-styleguide

AngularJS styleguide for teams
https://ultimateangular.com
5.96k stars 700 forks source link

class constructors must be invoked with |new| #159

Open fstodulski opened 7 years ago

fstodulski commented 7 years ago

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 ?

hadicahyadi commented 7 years ago

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