0
votes

I am trying to create a sample applicaiton with Angular 8 and using ngx-datatable. I am constantly getting error 'ngx-datatable-column' is not a known element. I have already tried solutions like importing NgxDatatableModule into child component instead of appModule or restarting system after installation. It's still there. I am using all latest versions:

"@angular/core": "8.2.6", "@swimlane/ngx-datatable": "^16.0.3", NVM Node: 12.16.1

app.module.ts :

import { NgxDatatableModule } from '@swimlane/ngx-datatable';

@NgModule({
  declarations: [
    AppComponent,
    LandingComponent
  ],
  imports: [
    BrowserAnimationsModule,
    BrowserModule,
    [NgxDatatableModule],
    RouterModule.forRoot(routes, {useHash: true}),
    SiLandingPageModule,
    SharedModule,
    HttpClientModule,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: (createTranslateLoader),
        deps: [HttpClient]
      }
    })
  ],
  exports: [RouterModule],
  bootstrap: [AppComponent]
})

Component file is exactly like given here : https://github.com/swimlane/ngx-datatable/blob/master/src/app/basic/inline.component.ts

2

2 Answers

0
votes

In your imports section in app.module.ts change the below:

From: [NgxDatatableModule]

To: NgxDatatableModule

0
votes

Not sure why but downgrading Node to 12.15.0 did the trick. The error went off!