ng-repeat创建的元素实现单个点击选中

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ng-repeat创建的元素实现单个点击选中相关的知识,希望对你有一定的参考价值。

html

<div ng-repeat="a in b" ng-click="click(a)" na-class="{{‘classname‘:data ===‘xxx‘}}"></div>

 

controller

$scope.data = resp.xxxx;

$scope.click=function(e){

  console.log(e);

}

以上是关于ng-repeat创建的元素实现单个点击选中的主要内容,如果未能解决你的问题,请参考以下文章