javascript - add multiple classes on ng-click in ng-repeat to a selected row -


i'm trying add classes selected div in ng-repeat. if this:

<div ng-class="{'selecte':isselected,'normal':'!isselected'}" ng-repeat="oneayah in ayahs" ng-click="selectparticular(oneayah)">      {{oneayah.text}}  </div> 

it changes class of divs within ng-repeat. (isselect bool toggles every time div clicked.)

your second ngclass param (normal) checking string isselected since quoted it, not bool:

ng-class="{'selecte':isselected,'normal':!isselected}"                                               ^^^remove quotes around me 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

spring cloud - How to configure SpringCloud Eureka instance to point to https on non standard port -

javascript - Bootstrap Popover: iOS Safari strange behaviour -