Angular 8/ Reactive Form - Converting result of checkbox event to a string value

前端 未结 2 536
面向向阳花
面向向阳花 2021-01-28 07:52

I have my Reactive form with field - Status (which can have values \'A\' or \'I\'):

this.form = this.formBuilder.group({
          result_info: this.formBuilder.         


        
2条回答
  •  执笔经年
    2021-01-28 08:22

    You can retrieve the value like this:

    
    
    test(event) {
        console.log(event.target.value)
        return event.target.value
    }
    

    and then you assign the value of the property status to the result of the function test()

提交回复
热议问题