Tüm sayfayı birkaç kullanıcı bağlamına göre oluşturduktan ve birkaç $httpistekte bulunduktan sonra , kullanıcının bağlamları değiştirebilmesini ve her şeyi yeniden oluşturabilmesini istiyorum (tüm $httpistekleri yeniden gönderme vb.). Kullanıcıyı başka bir yere yönlendirirsem işler düzgün çalışır:
$scope.on_impersonate_success = function(response) {
//$window.location.reload(); // This cancels any current request
$location.path('/'); // This works as expected, if path != current_path
};
$scope.impersonate = function(username) {
return auth.impersonate(username)
.then($scope.on_impersonate_success, $scope.on_auth_failed);
};
Eğer kullanırsam $window.location.reload(), o zaman bir yanıt bekleyen bazı $httpistekleri auth.impersonate(username)iptal edilir, bu yüzden bunu kullanamam. Ayrıca, kesmek de $location.path($location.path())çalışmıyor (hiçbir şey olmuyor).
Tüm istekleri tekrar göndermeden sayfayı yeniden oluşturmanın başka bir yolu var mı?