imsi imsi imsi imsi - 1 month ago 16
CSS Question

how to remove a css class dynamically in ionic

i'm using in my ionic project a ion-toggle, when i open the app in the browser the ion-toggle's html generated is:

<div class="noToggleBorder item item-toggle toggle-large ng-empty ng-valid" ng-model="checkarrivee.boo[var.id]" ng-click="checkarrivee.isMissionSelected(var.id,checkarrivee.ficheDeMission.id)" toggle-class="toggle-positive"><div ng-transclude=""><span class="ng-binding">Ceintures De Sécurités Passagères</span></div><label class="toggle toggle-positive disable-user-behavior"><input type="checkbox" ng-model="checkarrivee.boo[var.id]" class="ng-pristine ng-untouched ng-valid ng-empty"><div class="track"><div class="handle"></div></div></label></div>


My question is: How i can remove the item class from this div dynamically??

Answer

<div class="noToggleBorder item-toggle toggle-large ng-empty ng-valid" ng-class="{item: checkValue()}" ng-model="checkarrivee.boo[var.id]" ng-click="checkarrivee.isMissionSelected(var.id,checkarrivee.ficheDeMission.id)" toggle-class="toggle-positive"><div ng-transclude=""><span class="ng-binding">Ceintures De Sécurités Passagères</span></div><label class="toggle toggle-positive disable-user-behavior"><input type="checkbox" ng-model="checkarrivee.boo[var.id]" class="ng-pristine ng-untouched ng-valid ng-empty"><div class="track"><div class="handle"></div></div></label></div>

put 'item' class in ng-class and depend on expression show the item class.

Comments