延长类当我尝试从一个类,它是在一个库基础上扩展https://github.com/jhades/angular2-library-example从angularjs 2库
即 - 类LIB:
export class Stuff {
foo: string = "BAR";
}
类在我的应用程序
export class SomeClass extends Stuff {
}
我总是得到以下错误:
EXCEPTION: Uncaught (in promise): Error: Error in :0:0 caused by: Class constructor Stuff cannot be invoked without 'new'
TypeError: Class constructor Stuff cannot be invoked without 'new'
at new HomeComponent (http://localhost:3000/main.bundle.js:46859:16)
at new Wrapper_HomeComponent (/AppModule/HomeComponent/wrapper.ngfactory.js:7:18)
at CompiledTemplate.proxyViewClass.View_HomeComponent_Host0.createInternal (/AppModule/HomeComponent/host.ngfactory.js:15:29)
at CompiledTemplate.proxyViewClass.AppView.createHostView (http://localhost:3000/main.bundle.js:58198:21)
at CompiledTemplate.proxyViewClass.DebugAppView.createHostView (http://localhost:3000/main.bundle.js:58458:52)
at ComponentFactory.create (http://localhost:3000/main.bundle.js:28964:25)
at ViewContainerRef_.createComponent (http://localhost:3000/main.bundle.js:42370:45)
at RouterOutlet.activate (http://localhost:3000/main.bundle.js:46144:40)
at ActivateRoutes.placeComponentIntoOutlet (http://localhost:3000/main.bundle.js:15248:16)
at ActivateRoutes.activateRoutes (http://localhost:3000/main.bundle.js:15222:22)
at http://localhost:3000/main.bundle.js:15177:58
at Array.forEach (native)
是否包含这门课吗? –
是的,我包括它 –