There is a way to set a radio button as a number type instead a string?

时间:2019-04-08 13:18:37

标签: angular angular-material

I'm using material.angular.io. I would like know if there is way to set a Radio Button as a number type instead a string type.

Is it that i'm using: https://material.angular.io/components/radio/overview

2 个答案:

答案 0 :(得分:0)

I reached it yet!! I need just set a default value number on my controller, for example:

public defaultValue = 10;

And on html set this model

<mat-radio-group aria-label="Record Calls" [(ngModel)]="defaultValue">

And it will be handled as a number.

答案 1 :(得分:0)

<mat-radio-group aria-label="Record Calls" value = "your number">