angular.copy Fonksiyonu;
Kaynağın bir nesne ya da dizi olması durumunda kopyasını oluşturur.
Örnek
angular.module('deneme', [])
.controller('w3tr', ['test', function($scope) {
$scope.master= {};
$scope.update = function(user) {
$scope.master= angular.copy(user);
};
$scope.reset = function() {
angular.copy($scope.master, $scope.user);
};
$scope.reset();
}]);
Codepen Ön izleme
Kullanımı
angular.copy(source, [destination]);