I have this code in angular
$scope.b = {text: "b"};
$scope.a = {};
$scope.a = $scope.b;
$scope.a.text = "a";
console.log($scope.b); // Object {text: "a"};
It should be print Object {text: "b"}. I don't want 2 variables link together (when I change a, b should not change)
$scope.a = $scope.b;then why do you have that line?