Angular 意外值';doughnutChart.component.d.ts';由模块';app.module.ts';
我在使用ng build--prod时,在控制台中得到了错误 中的意外值“DoughnutChartComponent” E:/angular/node_modules/angular-d3-charts/bundle/doughnutChart.component.d.ts' 由中的模块AppModule声明 E:/angular/src/app/app.module.ts'。请添加一个 @管道/@指令/@组件注释 但是当使用ngs--open时,应用程序在控制台中执行时没有错误 我使用的是“angular-d3-charts”:“^5.0.0”版本的angular-d3-charts 应用程序模块.tsAngular 意外值';doughnutChart.component.d.ts';由模块';app.module.ts';,angular,Angular,我在使用ng build--prod时,在控制台中得到了错误 中的意外值“DoughnutChartComponent” E:/angular/node_modules/angular-d3-charts/bundle/doughnutChart.component.d.ts' 由中的模块AppModule声明 E:/angular/src/app/app.module.ts'。请添加一个 @管道/@指令/@组件注释 但是当使用ngs--open时,应用程序在控制台中执行时没有错误 我使用的是“
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { LoginComponent } from './access/login/login.component';
import { HomeComponent } from './home/home.component';
import { AccessComponent } from './access/access.component';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { FormsModule } from '@angular/forms';
import { CookieService } from 'ngx-cookie-service';
import { AccountComponent } from './account/account.component';
import { NgMultiSelectDropDownModule } from 'ng-multiselect-dropdown';
import {Auth} from './auth.service';
import {RlTagInputModule} from 'angular2-tag-input';
import {Ng2Webstorage} from 'ngx-webstorage';
import { DataTablesModule } from 'angular-datatables';
import { UploadFileService } from './upload-file.service';
import {SharedModule} from './account/shared.module';
import { Daterangepicker } from './daterangepicker/daterangepicker.module';
import {ToasterModule, ToasterService} from 'angular2-toaster';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MultiselectDropdownModule } from 'angular-2-dropdown-multiselect';
import { LeafletModule } from '@asymmetrik/ngx-leaflet';
//import {TooltipModule} from "ngx-tooltip";
import {TooltipModule} from 'ng2-tooltip-directive';
import {PopoverModule} from "ngx-popover";
import { RecaptchaModule, RECAPTCHA_SETTINGS, RecaptchaSettings } from 'ng-recaptcha';
import { RecaptchaFormsModule } from 'ng-recaptcha/forms';
import { MixpanelService } from './mixpanel.service';
import { ReportsComponent } from './account/reports/reports.component';
import {DataTableModule} from "angular-6-datatable";
import { DashboardComponent } from './account/dashboard/dashboard.component';
import { ListManagementComponent } from './account/list-management/list-management.component';
import { SegmentManagementComponent } from './account/segment-management/segment-management.component';
import { CampignManagementComponent } from './account/campign-management/campign-management.component';
import { TemplateManagementComponent } from './account/template-management/template-management.component';
import { DoughnutChartComponent, PieChartComponent, BarChartComponent } from 'angular-d3-charts';
//import { ChartsModule } from 'ng2-charts'
@NgModule({
declarations: [
AppComponent,
LoginComponent,
HomeComponent,
AccessComponent,
AccountComponent,
ReportsComponent,
DashboardComponent,
ListManagementComponent,
SegmentManagementComponent,
CampignManagementComponent,
TemplateManagementComponent,
DoughnutChartComponent,
PieChartComponent,
BarChartComponent,
],
imports: [
BrowserModule,
RlTagInputModule,
AppRoutingModule,
FormsModule,
HttpClientModule,
Ng2Webstorage,
DataTablesModule,
SharedModule,
Daterangepicker,
BrowserAnimationsModule,
ToasterModule.forRoot(),
LeafletModule.forRoot(),
NgMultiSelectDropDownModule.forRoot(),
MultiselectDropdownModule,
TooltipModule,
PopoverModule,
RecaptchaFormsModule,
RecaptchaModule,
DataTableModule,
//ChartsModule
],
providers: [CookieService,MixpanelService,Auth,UploadFileService,{
provide: RECAPTCHA_SETTINGS,
useValue: {
siteKey: 'xxxx',
} as RecaptchaSettings,
}],
bootstrap: [AppComponent]
})
export class AppModule { }
来自节点\u模块\angular-d3-charts\bundle\doughnutChart.component.d.ts的doughnutChart.component.d.ts
从'@angular/core'导入{EventEmitter};
导出声明类DoughnutChartComponent{
宽度:数字;
高度:数字;
iconWidth:数字;
iconHeight:数字;
外层:数量;
内半径:数字;
资料:有;
centerImage:任何;
扩展切片:布尔;
chartID:字符串;
中间文本:字符串;
middleTextColor:字符串;
middleTextFontSize:字符串;
centerImageEvent:EventEmitter;
构造函数();
ngOnInit():void;
renderChart():void;
}
能否显示app.module.ts和doughnutChart.component.d.ts的代码?更新了问题@SunnyParekh
import { EventEmitter } from '@angular/core';
export declare class DoughnutChartComponent {
width: number;
height: number;
iconWidth: number;
iconHeight: number;
outerRadius: number;
innerRadius: number;
data: any;
centerImage: any;
spreadSlice: boolean;
chartID: string;
middleText: string;
middleTextColor: string;
middleTextFontSize: string;
centerImageEvent: EventEmitter<{}>;
constructor();
ngOnInit(): void;
renderChart(): void;
}