Is there a way to unbind the reference when we are assigning values from scope properties?
For example I have $scope.X and $scope.Y. At some point in my function I want to assign the value of $scope.Y at that time to $scope.X:
$scope.X = $scope.Y
However, whenever scope.Y changes, looks like $scope.X changes too. Is there a way to avoid the chain? I just want to assign the value of $scope.Y once.
I tried using angular copy but it didn't work:
$scope.X = angular.copy([$scope.Y])[0];
Thanks