【Angular】引用Echart组件出现的问题“Can't bind to 'chartType' since it isn't a known property of 'echart'”

       公司做的项目Angular时候,在引用Echart组件时出现问题“Can't bind to 'chartType' since it isn't a known property of 'echart'”

【Angular】引用Echart组件出现的问题“Can't bind to 'chartType' since it isn't a known property of 'echart'”

原因:没有引入相关组件

解决办法:在上一级的

module.ts中引入EChartOptionDirective

import { EChartOptionDirective }from '../workspace/physical-project/statistics/echart-option.directive';

@NgModule中的declarations里面引入EChartOptionDirective

@NgModule({
imports: [
CommonModule,
HttpModule,
SearchModule,
MenubarModule
],
declarations: [
TestBlankComponent,
EChartOptionDirective
],
providers:[]
})

       这样页面就显示出来了。