0
I have the following code, to undo the changes:
    $pageContent = content;
    $scope.page = $pageContent.page;
    var pageBackup = $pageContent.page;
    $scope.cancelChanges = function() {
        $scope.page = pageBackup;
        $scope.$apply;
    };
But when I change something into $scope.page also changes in the pageBackup. Could someone explain to me why this occurs?
I managed to take the
angular.copysame XD was worth– Caio Gomes