I am working on Edit/Save data using AngularJS. Below is the very basic code sample of what I am trying to achieve.
Editing and saving the data functionality is working fine before i use the below code to "repeater" selector.
ng-repeat="var in [1,2,3]"
If you see it doesn't behave the same for all textarea elements in "ng-repeat" case. How can I target the selected textarea at the time of Edit/Save button click.
ANGULARJS CODE
var app = angular.module('myapp', []);
app.controller('myctrl', ['$scope', function ($scope) {
$scope.editEnabled= false;
$scope.dummydata= "This is dummy data";
$scope.editData=function(){
$scope.editEnabled = true;
$scope.inputText = $scope.dummydata;
};
$scope.saveData=function(){
$scope.editEnabled = false;
$scope.dummydata = $scope.inputText;
};
$scope.disableEdit= function(){
$scope.editEnabled = false;
};
}]);
Thanks in advance for any help.