angularjs - Ionic radio buttons: group disappears -


i using ionic radio buttons. code:

<div class="item">   <span class="input-label">category : </span>   <ion-radio ng-model="csspre" ng-value=0>saroj</ion-radio>   <ion-radio ng-model="csspre" ng-value=1>sadhana</ion-radio>   <ion-radio ng-model="csspre" ng-value=2>neha</ion-radio> </div> <div class="item">   <span class="input-label">work place : </span>   <ion-radio ng-model="workplace" ng-value="0">at clinic</ion-radio>   <ion-radio ng-model="workplace" ng-value="1">at center</ion-radio> </div> 

when click on first group works fine, select work place second group selected category disappears.

your code works fine, take codepen:

<div class="item">     <span class="input-label">category: </span><br />     <span>selected value: {{csspre}}</span>               <ion-radio name="csspre" ng-model="csspre" ng-value="0">saroj</ion-radio>     <ion-radio name="csspre" ng-model="csspre" ng-value="1">sadhana</ion-radio>     <ion-radio name="csspre" ng-model="csspre" ng-value="2">neha</ion-radio> </div> <div class="item">     <span class="input-label">work place : </span> <br />     <span>selected value: {{workplace}}</span>                        <ion-radio name="workplace" ng-model="workplace" ng-value="0">at clinic</ion-radio>     <ion-radio name="workplace" ng-model="workplace" ng-value="1">at center</ion-radio> </div> 

i added quotation marks first radio group , added selected value of each group.

update: added name attribute each ion-radio , fixed codepen demo.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -