I have a NPM package that I need to load most of the modules for. I can do the import statement like this:
import * as primeng from 'primeng/primeng';
But in my @NgModule Angular declaration, I need to explicitly list out every single element in the imports section:
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule, FormsModule, HttpModule,
// primeNG
primeng.ButtonModule, primeng.ChipsModule, primeng.ContextMenuModule, primeng.DataTableModule,
primeng.DialogModule, primeng.DropdownModule, primeng.EditorModule, primeng.FieldsetModule,
primeng.GMapModule, primeng.GrowlModule, primeng.InputSwitchModule, primeng.InputTextModule,
primeng.PanelMenuModule, primeng.PanelModule, primeng.SharedModule, primeng.SpinnerModule, primeng.TreeModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}
Is there any way to instead use something like primeng.keys()
(which doesn't work) to my imports section of the NgModule?