I am trying to create an application in which I want to load feature
modules in as separate webpack chunks which will be compiled in a separate
project. Webpack part I have taken care of and it is working fine. In html
order of the script is:-
common.js
polyfils.js
angular vendor bundles.js
feature modules1.js
feature module2.js
----
mainapplication.js
Main application.js has bootstrapping logic. The feature modules have only
modules and their components. common.js has a javascript class to register
module and get the list of registered modules. So from feature module
main.ts file I am doing this:-
import {FeatureModule} from './FeatureModule';
common.Modules.register(FeatureModule).
Now in mainapplication.js my app.module is doing this:
let featureModules = common.Modules.getRegisteredModules();
let importModules = [
BrowserModule,
FormsModule,
UpgradeModule,
HttpClientModule,
UIRouterUpgradeModule
];
importModules = importModules.concat(featureModules);
@NgModule({
imports: importModules,
declarations: [AppComponent],
providers: fxpServices,
bootstrap: [
AppComponent
],
entryComponents: [],
exports: []
})
export class AppModule {
}
I am getting an error while bootstrapping appModule:
Unexpected value 'MyProfileModule' imported by the module 'AppModule'.
Please add a @NgModule annotation.
I debugged and found that complier is unable to find property decorators or
annotations for this module. However if I copy the feature module to the
main project and import it in normal ways, it works.
Can somebody please help.
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.