当将WebDataRocks集成到角度为枢轴表时,我得到了误差。
属性'next‘在'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)
});
}
}发布于 2021-07-06 10:16:07
我不能用相同的代码复制这个。您是否在示例项目中更改了其他内容?
发布于 2021-08-17 12:28:27
EventEmitter的next方法不适用于emit
this.cellclick.emit(cell)https://stackoverflow.com/questions/68067108
复制相似问题