4

i have an error when i run ng build -prod in my angular 4 application it said

"ERROR in Unexpected value 'DataTableModule in Y:/example/node_modules/angular-2-data-table/dist/index.d.ts imported by the module 'AppModule. Please add a @NgModule annotation."

and this is index.d.ts file

import { DataTable } from './components/table.component';

import { DataTableColumn } from './components/column.component';

import { DataTableRow } from './components/row.component';

import { DataTablePagination } from './components/pagination.component';

import { DataTableHeader } from './components/header.component';

export * from './components/types';

export * from './tools/data-table-resource';

export { DataTable, DataTableColumn, DataTableRow, DataTablePagination, 
DataTableHeader };

export declare const DATA_TABLE_DIRECTIVES: (typeof DataTable | typeof 
DataTableColumn)[];

export declare class DataTableModule {

}

how can i fix this?

NB: i'm still new on angular and this is not my module, i use this package https://github.com/ggmod/angular-2-data-table

Thanks

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Sandy
  • 210
  • 3
  • 16
  • According to this https://github.com/ggmod/angular-2-data-table/blob/master/src/index.ts the code you posted is missing `ngModule` – Suraj Rao May 19 '17 at 07:01
  • @suraj : wow that's works !!! Thank you :) – Sandy May 19 '17 at 07:25
  • @suraj : i have encounter another error now "ERROR in Unexpected value 'DataTable in example/node_modules/angular-2-data-table/dist/components/table.component.d.ts' declared by the module 'DataTableModule in example/node_modules/angular-2-data-table/dist/index.d.ts'. Please add a @Pipe/@Directive/@Component annotation." – Sandy May 19 '17 at 08:17

0 Answers0