Chartjs-Chart in other module

0👍

You need to add p-chart in declarations : [ ] in app.module.ts so that you can access it in other components.

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';    
import { SalesComponent } from './sales.component';
import { GenericModule } from '../generic.module';
import { ChartModule } from 'primeng/chart';
import { PChartComponent} from './pchart.component';


@NgModule({
  declarations: [SalesComponent, PChartComponent],
  imports: [
    CommonModule,
    GenericModule,
    ChartModule
  ]
})
export class SalesModule { }

Leave a comment