I want to assign some values when a button click event happens via event parameter:
$scope.update = function(context) {
$scope.master = context;
};
When you manipulate primitive types (like int) in Javascript, =
and angular.copy
are the same as any assignment results in copying the value of the variable.
When you manipulate objects in Javascript, =
assign a reference to the existing object to the variable and angular.copy
is copying, that means creating a new object with the same properties and values and assigning the new object's reference to the variable.