Angular 2 RC6 problem !!!
So imagine the situation where we have a standard class such as...
export abstract class FooBase {}
and then we want to export this class to be used by other modules within an Angular 2 RC6 web app, the NgModule code may look like this...
@NgModule({
declarations: [FooBase],
exports: [FooBase],
imports: [CommonModule],
})
export class OurModule {}
Unfortunately when running this inside chrome it returns with...
Unexpected value 'FooBase' exported from module 'OurModule'
This base class is used to extend an existing class inside another module, simple stuff really, what am I doing wrong here !!!
Don't use NgModule
imports
, exports
, declarations
for imports and exports of class declarations. @NgModule
is only for components, directives, pipes and services.
Just use normal TypeScript imports and exports.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With