Open moose4lord opened 6 years ago
OK, after looking through some other ngx-datatable examples on the web I found this solution. Change the import in the filter demo from this:
import {DatatableComponent} from '../../src/components/datatable.component';
to this:
import { DatatableComponent } from '@swimlane/ngx-datatable';
That fixed my "ng build -prod" issue. Someone from swimlane should probably update their filter demo.
I'm submitting a ... (check one with "x")
Current behavior Currently when the filter demo described here is built with the -prod flag (i.e. ng build -prod), the build fails with the following errors:
"ng serve" and ng build without the -prod flag work fine.
Expected behavior The filter demo should build successfully with the -prod flag.
Reproduction of the problem The filter demo shows the problem, although only when trying to build with the -prod flag.
What is the motivation / use case for changing the behavior? Would like to use the filter feature in a production env.
Please tell us about your environment: Windows 7 @swimlane/ngx-datatable@11.1.5 @angular/cli@1.5.5 @angular/core@5.0.5 rxjs@5.5.3 typescript@2.4.2
Table version: 0.8.x ngx-datatable v11.1.5
Angular version: 2.0.x Angular 5.0.5
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ] n/a
Language: [all | TypeScript X.X | ES6/7 | ES5] typescript 2.4.2
This issue was flagged a couple months ago here: https://github.com/swimlane/ngx-datatable/issues/925 which was closed as fixed, but seems like it wasn't fixed completely.
The issue seems to be related to this import statement at the top of the filter demo file:
import {DatatableComponent} from '../../src/components/datatable.component';
If I comment out that line (and the bits of code that use DatatableComponent), then a build with the -prod flag works fine.