Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Cannot declare 'IgxTimeXAxisComponent' in an NgModule as it's not a part of the current compilation.
posted

I'm trying to modify the sample project found here:
https://ko.infragistics.com/community/forums/f/ignite-ui-for-angular/122841/igx-pie-chart-igx-line-chart/540293#540293

testsampleLine.zip

I've taken the line chart and I'm converting the igx-category-x-axis to an igx-time-x-axis. This works fine, but then I'm trying to package the chart up as a component and display it via an IgxNavigationDrawer. If I leave it as a category-x-axis there's no problem, but as soon as I change it to an igx-time-x-axis (and include IgxTimeXAxisComponent in the declarations section of my app.module.ts) then I get this error in my ng serve console:

Cannot declare 'IgxTimeXAxisComponent' in an NgModule as it's not a part of the current compilation.

and in the browser console I get

core.js:4009 Uncaught Error: Angular JIT compilation failed: '@angular/compiler' not loaded!

I have attached minimal sample where you should be able to reproduce the problem. The sample works as-is, but if you uncomment line 28 of app.module.ts you will see the error:

    // IgxTimeXAxisComponent

dashboard.zip

  • 7535
    Offline posted

    Hello David,

    I tested your sample and noticed that you are missing IgxTimeXAxisModule to add into import .

    Needs to add this:

    import { IgxTimeXAxisModule } from "igniteui-angular-charts";
     IgxRippleModule,
        IgxGridModule,
        IgxTimeXAxisModule,
        IgxNumericYAxisModule,
    also i noticed that you dont need to include IgxTimeXAxisComponent in the declarations. This:
      declarations: [
        AppComponent,
        PowerComponent,
      //  IgxTimeXAxisComponent
    Let me know if you have any question.
    Regards,