$scope.editPostComment = false;
当我点击btn
时,它会显示所有重复项目中的textarea
,当我只想在点击的div上显示它时!
<div class="commentBox" ng-show = "editPostComment" >
<textarea name="editor2" class="content-box allfilecomment" id="comment-box" focus-me="{{focusCommentBox}}"
ng-model="allCommentText"
markdown-editor="{'iconlibrary': 'fa', addExtraButtons: true, resize: 'vertical'}"
rows="10" >
</textarea>
<div class="hints">
<span class="boldtext">**Bold**</span>
<span class="italictext">_itlaics_</span>
<span class="striktext">~~strike~~</span>
<span class="codetext">'code'</span>
<span class="codetext">'''preformatted'''</span>
<span class="quotetext">>quote</span>
</div>
<div id="comment-btns">
<button class="btn btn-primary pull-left" ng-class="{'loading': commentig}" ng-disabled="commentig" ng-click="postAllComment(commentmode)">Edit</button>
</div>
</div>
答案 0 :(得分:1)
您需要使用索引为每行指定一个id,然后根据该行显示所述行的可见性。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="progress-bar-container">
<div id="progress-bar" class="progress-bar"></div>
</div>
<div id="logger">
</div>
&#13;
function showEdit(id) {
vm.editPostComment = id;
}
&#13;