I have an Angular (2) application configured with webpack that imports modules from another shared repository.
So, the general repository has a common.module.ts file with something like this:
@NgModule({ imports: [...], declarations: [...], providers: [...], exports: [...] }) export class CommonModule {}
and then in my main application I import this into my app.module.ts
@NgModule({ imports: [ ... CommonModule, ], declarations: [...], providers: [...], bootstrap: [AppComponent] }) export class AppModule { }
This works fine, as in Angular2, but then I try to switch to Angular 4.0 in my main project (without touching the general repository, as it is used by other repositories that are also not portable). So I change my versions in my .json package and rebuild, and everything seems fine, but then when I download the application in the browser, I get this
Fault Error: Unexpected value of "CommonModule" imported by "AppModule" module. Add a note @NgModule.
Does anyone know what is going on? CommonModule is already declared using @NgModule. I checked node_modules in case and something was wrong with the imported files and found common_module.d.ts that contains
... export declare class CommonModule {}
but itβs wonderful for me that the trunk file and decorator have been deleted here.
Any ideas?
source share