交换点击信息并隐藏其他信息angularjs

时间:2017-10-23 06:38:59

标签: jquery angularjs

$scope.parentUser = auth.getCurrentUser();
$scope.currentSetUser = false;
        $scope.swapUser = function swapUser(user_id)
        {

            $scope.children.filter(function(item){

                if(item.user_id == user_id)
                {
                    $scope.state = !$scope.state;
                    $scope.currentSetUser = user_id;
                    return $scope.parentUser = item;
                }
            });

        }

 <uib-accordion close-others="oneAtATime">    
                            <uib-accordion-group class="userAssign" ng-repeat="user in children">

                            <span class="main-header-cardion">
                              <a role="button" class="collapsed" data-toggle="collapse" data-parent="#accordion" href="" ng-click="swapUser(user.user_id);" aria-expanded="true" aria-controls="collapseTwo">
                              <span ng-if="user.type == '2'">{{user.first_name}}- {{user.user_id}}</span>
                              <span ng-if="user.type == '3'">{{user.name}}- {{user.user_id}}</span>
                            </a>
                            </span>

               <section class="accordion1" ng-show="state">

 <div class="confirm-page-header"> Details of {{parentUser.first_name}} </div>
</section>
 <uib-accordion>
 <uib-accordion-group>

输出看起来像 约翰 - 112 吉米 - 113

我想要的是,当我点击John-112时,我想得到john的信息并隐藏jimmy的信息,当我点击jimmy时我想得到jimmy的信息并隐藏john的信息

目前,当我点击john时,它会获取有关jimmy和john的信息,请指导如何解决此问题。

提前致谢

0 个答案:

没有答案