I'm working with ng-repeat .In the ng-repeat i'm repeating panel.The panel body consist of two part .First part is a paragragh which i fetch from the database using $http.get(). In the second part i have a button (edit button).When i click the edit button the paragraph in the first part should be hidden and text-area should appear with the content in the paragraph as default.But when i'm trying to achieve this im getting an idea when i click one edit button all of my paragragh hides and the textarea appear .How can i restrict it .
$scope.editorEnabled = false;
$scope.enableEditor = function() {
$scope.editorEnabled = true;
};
<div ng-repeat="(key,rec) in recordcomment">
<div class="row">
<div class="col-md-10">
<div class="panel panel-default">
<div class="panel-heading">
heading
</div>
<div class="panel-body" style="background-color:white;">
<p ng-hide="editorEnabled">{{rec.comment}}</p>
<textarea ng-model="rec.comment" ng-show="editorEnabled"></textarea>
<button class="btn btn-primary pull-right" ng-click="enableEditor()">Edit</button>
</div>
</div>
</div>
</div>
</div>