akveo / ng2-smart-table

Angular Smart Data Table component
https://akveo.github.io/ng2-smart-table/
MIT License
1.63k stars 877 forks source link

ng2-smart-table' is not a known element - Angular - 6.0.3 #860

Open nirajsonawane opened 6 years ago

nirajsonawane commented 6 years ago

Geeting below error

compiler.js:1016 Uncaught Error: Template parse errors:
'ng2-smart-table' is not a known element:
1. If 'ng2-smart-table' is an Angular component, then verify that it is part of this module.
2. If 'ng2-smart-table' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("

Added below import in compoment file import { Ng2SmartTableModule } from 'ng2-smart-table'; Register it by adding to the list of directives of in app.module.ts:

NgModule({
  declarations: [
    AppComponent,
    DataTableComponent
  ],
  imports: [
    ----
    Ng2SmartTableModule
-----
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { 

Added below line in component.html <ng2-smart-table ></ng2-smart-table>

Anytjing else that i am missing ?

pie62 commented 6 years ago

same herre. <ng2-smart-table ></ng2-smart-table> in sub module get error 'ng2-smart-table' is not a known element: If you use <ng2-smart-table ></ng2-smart-table> in sub module, just import Ng2SmartTableModule to your sub module.