I want to assign some values when a button click event happens via event parameter:
$scope.update = function(context) {
$scope.master = context;
};
As can be read here angular.copy()
performs a deep copy (cf. "clone") of the argument - essentially creating a new object - whereas using the assignment operator =
just assigns reference's.
Thus in the latter case, if you we're to change something in $scope.master
you would also change context
.
Cheers,