0

For example my parent controller variable name is

$scope.studentInfo = {
    studentId: 1,
    name: 'aaaa',
    address: {
        doorno: 153,
        street: 'Gandhi street'
    }
}

I am changing the this parent variable through child controller example, changing the variable to some other value

$scope.student = angular.copy($scope.studentInfo);
$scope.studnet.address.doorno = 150;
$scope.studentInfo = $scope.student;

then if we assigning the value to parent controller, then the value will be changing alone in child controller but not parent controller. If I assign each and every property then the value will reflect in parent json also.

Parthipan S
  • 180
  • 9

0 Answers0