<div class="details" ng-repeat="shopInfo in shops.shopInfos" ng-touchstart="addClass()" ng-touchend="" ng-touchmove="removeClass()">
<span class="detai-pic"><img ng-src="{{fn.getShopIcon(shopInfo)}}" /></span>
<span class="detai-name">{{shopInfo.shopName}}</span>
</div>
上述代码所示,是一个循环,用的是angularjs的touch事件,当点击时,我要在class=“detail”变成“detail_on”,怎么做改变,注意它是一个循环的div。
那这样吧: