Reputation: 2579
On API Success response. I'm trying to make a copy of data but on $scope change it gets affected too. I'm Working with Angular Component structure project.
Example
var actualData = $scope.data;
var workingData = $scope.data;
Now later on in project if workingData changes, it also changes actualData.
Thanks.
Upvotes: 0
Views: 187
Reputation: 2304
You could use angular.copy(source, [destination]) to make a deep copy of the original object.
angular.copy(actualData,workingData)
Upvotes: 1