Pra*_*ept 2 javascript events eventemitter angularjs webdatarocks
在以角度为数据透视表集成 WebDataRocks 时,我收到错误
类型“EventEmitter<CellData>”上不存在属性“next”
这是我的代码,
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)
});
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
75 次 |
| 最近记录: |