ggmod / angular-2-data-table-demo

Demo application and examples for the Angular 2 data table (https://github.com/ggmod/angular-2-data-table)
MIT License
29 stars 98 forks source link

Data Table is not showing when build and host using --production build command - Angular 4+ #18

Closed rajeshkdev closed 2 years ago

rajeshkdev commented 6 years ago

I have an angular App, when i build and host the site in IIS, everything is cool except the Data Table. The data table is not rendering any data or not showing. There is no console errors. Even i found the empty HTML code that i copy pasted below.

Production buildn Command that i used:

ng build --prod --base-href /MyAPP/

The Same thing is working with following command: Which is Dev Build. Data Table is working well with this build command.

ng build --base-href /MyAPP/

I'm using:

Bootstrap 3.3.7

Angular Details:

λ ng -v @angular/cli: 1.3.0 node: 6.11.0 os: win32 x64 angular/animations: 4.3.6 angular/common: 4.3.6 angular/compiler: 4.3.6 angular/core: 4.3.6 angular/forms: 4.3.6 angular/http: 4.3.6 angular/platform-browser: 4.3.6 angular/platform-browser-dynamic: 4.3.6 angular/router: 4.3.6 angular/cli: 1.3.0 angular/compiler-cli: 4.3.6 angular/language-service: 4.3.6

I found this empty HTML code which is not rendering anything.

<data-table _ngcontent-c7="" id="schedule-grid" style="font-size: 14px !important;"> <data-table-column _ngcontent-c7=""> </data-table-column> <data-table-column _ngcontent-c7=""> </data-table-column> <data-table-column _ngcontent-c7=""> </data-table-column> <data-table-column _ngcontent-c7=""> </data-table-column> <data-table-column _ngcontent-c7=""> <!----> <!----> </data-table-column> <data-table-column _ngcontent-c7=""> <!----> <!----> </data-table-column> </data-table>

What would be the issue?

Please kindly help and suggest the fix. Kind of stuck here!!!

rajeshkdev commented 6 years ago

We can solve this issue by Upgrading or Moving to the following GitHub and Commands.

Angular 4 Data Table

I have uninstalled the Angular 2 Data Table npm uninstall angular-2-data-table.

Installed Angular 4 Data Table:

npm install angular-4-data-table --save

Prodaction (Minification):

use import like this app.module.ts:

import { DataTableModule } from 'angular-4-data-table/src/index';

General Production Build Command:

ng build --prod --aot=false

For Me: ng build --prod --aot=false --base-href /MyAPP/

If you already implemented the Grid based on GGMod GitHub, you don't need to change to other data tables just upgrade to Angular 4 which is same as this but issues are resolved and upto date.