问题描述
在以角度为数据透视表集成 WebDaTarocks 时,出现错误
类型“EventEmitter
这是我的代码,
import { Component,ElementRef,Input,Output,EventEmitter,OnInit } from '@angular/core';
import * as WebDaTarocks from 'webdaTarocks';
@Component({
selector: 'app-wbr-pivot',template: `<div><div class='wbr-ng-wrapper'></div></div>`
})
export class WebdaTarocksComponent implements OnInit{
// params
@input() toolbar: boolean;
@input() width: string | number;
@input() height: string | number;
@input() report: WebDaTarocks.Report | string;
@input() global: WebDaTarocks.Report;
@input() customizeCell: (cell: WebDaTarocks.CellBuilder,data: WebDaTarocks.CellData) => void;
// events
@Output() cellclick: EventEmitter<WebDaTarocks.CellData> = new EventEmitter();
// api
public webDaTarocks: WebDaTarocks.Pivot;
// private
private root: HTMLElement;
constructor(private el: ElementRef) { }
ngOnInit() {
this.root = this.el.nativeElement as HTMLElement;
this.webDaTarocks = new WebDaTarocks({
container: this.root.getElementsByClassName('wbr-ng-wrapper')[0],width: this.width,height: this.height,toolbar: this.toolbar,report: this.report,global: this.global,customizeCell: this.customizeCell,cellclick: (cell: WebDaTarocks.CellData) => this.cellclick.next(cell)
});
}
}
解决方法
无法在我这边用相同的代码重现这个。您是否对示例项目中的其他内容进行了更改?