Angular 类型';事件';不可分配给类型';字符串';。角度打字错误

Angular 类型';事件';不可分配给类型';字符串';。角度打字错误,angular,typescript,Angular,Typescript,我对Angular很陌生,我遇到了一个打字问题 这是我得到的错误: Error: contact/contact.component.html:70:37 - error TS2322: Type 'Event' is not assignable to type 'string'. <mat-radio-group [(value)]="contactGender"> <mat-radio-button value="male

我对Angular很陌生,我遇到了一个打字问题

这是我得到的错误:

Error: contact/contact.component.html:70:37 - error TS2322: Type 'Event' is not assignable to type 'string'.
     <mat-radio-group [(value)]="contactGender">
     <mat-radio-button value="male">Male</mat-radio-button>

contact/contact.component.ts:6:16
      templateUrl: './contact.component.html',

哪里出错了?

更改导致此错误的HTML组件。在这里,我们使用ngModel而不是值绑定变量,并使用[]对值进行属性绑定

 <mat-label>Gender</mat-label>
    <mat-radio-group [(ngModel)]="contactGender">
        <mat-radio-button [value]="male">Male</mat-radio-button>
        <mat-radio-button [value]="female">Female</mat-radio-button>
    </mat-radio-group>
性别
男性
女性

更改导致此错误的HTML组件。在这里,我们使用ngModel而不是值绑定变量,并使用[]对值进行属性绑定

 <mat-label>Gender</mat-label>
    <mat-radio-group [(ngModel)]="contactGender">
        <mat-radio-button [value]="male">Male</mat-radio-button>
        <mat-radio-button [value]="female">Female</mat-radio-button>
    </mat-radio-group>
性别
男性
女性
 <mat-label>Gender</mat-label>
    <mat-radio-group [(ngModel)]="contactGender">
        <mat-radio-button [value]="male">Male</mat-radio-button>
        <mat-radio-button [value]="female">Female</mat-radio-button>
    </mat-radio-group>