angular2错误,因为EventEmmitter <y>需要Type(1)

时间:2018-03-19 06:37:05

标签: angular2-forms

事件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);
    }

1 个答案:

答案 0 :(得分:1)

应该是

 countRadioButtonSelectionChanged: EventEmitter<string> = new EventEmitter<string>();