javascript - Radiobuttons ng-checked not displaying div by default and works only onclick -


I'm new to Web Development with Congler JS. I am trying to show and hide the text box inside a box in the classroom. I have two radio buttons "Yes" and "no" . Therefore, when I click on Yes and hide the design, I am trying to show the text box. No longer, I am trying to use it only and use NG-Class and NG-model. Ng show / ng: hide.

When I click on a radio button by default (say yes) using ng-check = "true", why the divis is not displayed and clicked again on the button only goes. There is no ng-checked work for the NG-Class.

  & lt; Label class = "ui-radio checkbox-inline" & gt; & Lt; Input type = "radio" name = "toggle 1" data-check = "1" value = "yes" ng-model = "request_sam" /> & Lt; Period & gt; Yes & lt; / Span & gt; & Lt; / Labels & gt; & Lt; Label class = "ui-radio checkbox-inline" & gt; & Lt; Input type = "radio" ng-checked "true" name = "toggle 1" data-check = "2" value = "no" ng-model = "request_sim" /> & Lt; Period & gt; No & lt; / Span & gt; & Lt; / Labels & gt;    

Do not use ng-check this is only a radio box , But this ng-model value will not be updated.

Working HTML

  Instead of using ng-check,  ng-enter  & lt; Div ng-app & gt; & Lt; Div class = "radioToggle1" & gt; & Lt; Div class = "col-xs-12 form-group" id = "request_same" ng-init = "request_same = 'yes'' gt; <28> 

Yes or no & lt; / p & gt; & Lt; label class = "ui-radio checkbox-inline" & gt; & lt; input type = "radio" name = "toggle 1" data-check = "1" value = "yes" ng-model = "request_sum "/> Gt; & lt; Period & gt; Yes & lt; / span & gt; & lt; / Label & gt; Label class =" ui-radio checkbox-inline "& gt; & lt; input Type = "radio" name = "toggle 1" data-check = "2" value = "no" ng-model = "request_sam" /> gt; duration & gt; not & lt; / span & gt; & Lt; / labels & gt; & lt; / div & gt; & lt; div day Ta-show = "1" ng-square = "{active: request_same == 'yes'}" square = "hide-div" & gt; & lt; div class = "col-xs-12 col-md-12 BorderTop "& gt; & lt; h5 & gt; & lt; strong & gt; Vendor Details & lt; / strong & gt; & lt; / h5 & gt; & lt; Input Type =" Text "/> & Lt; / div & gt; & lt; / div & gt; & lt; / div & gt; & lt; div data-show = "2" & lt; / div & gt; & lt; / Div>

just added hide-div to hide the div by default by category and then ng-class

Hope this may help you.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -