I tryed to destroy a scope in a controller, But after destroying scope it's accessible, Why?
myApp.controller('modalCtrl', ['$scope', function($scope){
$scope.test = 'ha ha ha';
console.log($scope.test); // it laughs
$scope.$destroy();
console.log($scope.test); // it laughs again :/
}]);
Does it related to $digest and timing?
$destroy does two things:
So you can say that it is indeed a timing issue. Your scope will be destroyed but you wont know exactly when it'll be garbage collected. What you do know is that the scope is no longer accessible from parent scopes and for all intents and purposes should be considered 'dead'.