AngularJs. Is it possible to deselect HTML “radio” input by click?

后端 未结 5 473
再見小時候
再見小時候 2020-12-10 12:55

I have radio inputs and want to ucheck state by click on radio if current radio is checked.

This code:



        
5条回答
  •  醉梦人生
    2020-12-10 13:27

    You could do using below. set an attribute.

    public selectedMoiProfile : boolean  = false;
    
    
    
    
     onSelect(p: profile) {
         p.selectedProfile= p.selectedProfile? false : true;
     }
    

提交回复
热议问题