Getting value from checked box in angular 2 typescript

前端 未结 6 765
再見小時候
再見小時候 2021-02-04 03:58

I am using Angular 2 Typescript. I am facing a problem wherein I need to submit a form which contains check boxes. I need values that are in the attributes of checkboxes. The ch

6条回答
  •  时光取名叫无心
    2021-02-04 04:27

    enter code here
    

    submitForm(form:NgForm){
    console.log(form.value);
    }

    Use name attribute including label.id,so you will get all value in array form.

    GUESS THIS WILL HELP.

提交回复
热议问题