Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't bind to 'data' since it isn't a known property of 'p-chart'

Link:https://www.primefaces.org/primeng/#/chart/bar As given in the above link i tried giving code in .ts and html . And i have installed chart.js and primeng and m getting this error.

Can't bind to 'data' since it isn't a known property of 'p-chart'.

  1. If 'p-chart' is an Angular component and it has 'data' input, then verify that it is part of this module.
  2. If 'p-chart' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. (" ][data]="data">

"): ng:///AppModule/BarComponent.html@1:20 'p-chart' is not a known element: 1. If 'p-chart' is an Angular component, then verify that it is part of this module. 2. If 'p-chart' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. (" [ERROR ->]

like image 715
Sharz Avatar asked Aug 18 '17 10:08

Sharz


People also ask

Can't bind to data since it isn't a known property of P chart?

Can't bind to 'data' since it isn't a known property of 'p-chart'. If 'p-chart' is an Angular component and it has 'data' input, then verify that it is part of this module. If 'p-chart' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule. schemas' of this component to suppress this message.

Can't bind to label since it isn'ta known property of?

This error often means that you haven't declared the directive "x" or haven't imported the NgModule to which "x" belongs. Perhaps you declared "x" in an application sub-module but forgot to export it. The "x" class isn't visible to other modules until you add it to the exports list.

Can't bind to show since it isn't a known property of NGX loading?

Can't bind to 'show' since it isn't a known property of 'ngx-loading'. If 'ngx-loading' is an Angular component and it has 'show' input, then verify that it is part of this module. If 'ngx-loading' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.


1 Answers

have you tried to import the ChartModule to your project?:

Import this:

import { ChartModule } from 'primeng/chart';

and add this to your imports:

imports: [
    ChartModule
  ]
like image 116
Talesb Avatar answered Sep 23 '22 07:09

Talesb