在公司职位页面,点击按钮 技术和运营 先点击一次可以高亮,但再点击不能切换
来源:5-4 公司详情页controller完善(2)

Levin3860014
2017-05-30
<<div class="position-class" >
<h5>职位分类</h5>
<button ng-click="showPositionList($index)" class="{{$index===isActive? 'active':''}}" ng-repeat="cls in com.positionClass" ng-bind="cls.name"></button>
<ul >
<li class="p-r" ng-repeat="pos in com.positionClass">
<p ng-bind="pos.positionList[$index].name"></p>
<p ng-bind="pos.positionList[$index].createdDate"></p>
<span ng-bind="pos.positionList[$index].salary" class="p-a"></span>
</li>
</ul>
</div>
取到了值,但是点击按钮不能来回切换
angular.min.js:123 TypeError: v2.showPositionList is not a function at fn (eval at compile (angular.min.js:239), <anonymous>:4:246) at e (angular.min.js:284) at b.$eval (angular.min.js:148) at b.$apply (angular.min.js:149) at HTMLButtonElement.<anonymous> (angular.min.js:284) at hg (angular.min.js:39) at HTMLButtonElement.d (angular.min.js:39)
出现了这样的信息
1回答
-
Levin3860014
提问者
2017-05-30
自己解决问题了,哈哈
原来老师点击后利用点击把index传入$scope.positionList = $scope.com.positionClass[idx].positionList; 再repeat positionList 这个变量
10
相似问题