<ion-list radio-group>
<ion-radio name="choiceLng" ng-model="language" value="y" ng-value="'y'" ng-change="langChanged('y')">y</ion-radio>
<ion-radio name="choiceLng" ng-model="language" value="x" ng-value="'x'" ng-change="langChanged('x')">x</ion-radio>
</ion-list>
I created radio buttons using ion-list. I want to change style for childs of
ion-radio which are the input tag and the div. How can I "reach" this input tag and then change css dynamically using angularJs?
You can have
defaultclass on allion-radioelement. Then with proper CSS selector you can add style for its content likeThen you can make use of
ng-classand check value of ngModel language with its ng-value to apply particular class sayselectedto that label tag. In your case it's as followsNow here you're using ion-radio static so need to add that ng-class too every option but if you're using ng-repeat on it, it'll be only once just to compare model with ng-value variable. After along with model change
selectedclass will be added to only selected radio option so you can have CSS for its contents the same way:Working Codepen example to refer.