Property 'next' does not exist on type 'EventEmitter' in WebDataRocks

Viewed 629

While integrating the WebDataRocks in angular for pivot table, I am getting the error

Property 'next' does not exist on type 'EventEmitter<CellData>'

Here is my code,

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)
      });
    }
}
2 Answers

Can't reproduce this with the same code on my side. Have you changed anything else in the sample project perhaps?

EventEmitter's next method is deprecated in favor of emit

this.cellclick.emit(cell)
Related