事件Emmiter抛出以下错误
angular2错误,因为EventEmmitter需要Type(1)
selectedRadiobtn: string = 'All';
import { Component, Input, Output, EventEmitter } from "@angular/core"
export class EmployeeComponent {
@Output()
countRadioButtonSelectionChanged: EventEmitter[string] = new EventEmitter[string](); //Here im Getting An Error
Radiobtnchange() {
this.countRadioButtonSelectionChanged.emit(this.selectedRadiobtn);
}
答案 0 :(得分:1)
应该是
countRadioButtonSelectionChanged: EventEmitter<string> = new EventEmitter<string>();