ng-show,点击右侧切换元素[Angularjs]

时间:2015-08-14 01:47:36

标签: javascript jquery html angularjs

我wana切换元素但不是我需要的所有元素都被点击了。

例如,如果我点击按钮1,我有3个表单元素和3个按钮。我只需要切换1.表单元素。

这是我目前的代码:

角:

$scope.formWhat = false;
$scope.formShow = function(item){
                   $scope.formWhat = !$scope.formWhat;
               };

HTML:

<div ng-repeat="x in comments">
<a href="#" ng-click="formShow(x)">replay</a>
       <form id="<%x.id%>" ng-show="formWhat">
        blbllblblbl
        </form>
</div>

此代码将打开所有表单,但我需要点击哪个,任何想法?

0 个答案:

没有答案
相关问题