전체 페이지 렌더링 후 여러 가지 사용자 기반으로 한 사용자가 여러 '$ http 요청을 구매와 컨텍스트로' 내가 원하는 모든 것을 다시 렌더링 및 전환할 수 있게 컨텍스트로 다시 (http 요청 등의 '모든' $ 재전송). 만약 내가 그냥 리디렉션하십시오 사용자 다른 곳으로, 일도 제대로:
$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);
};
'다음' $ $ 를 사용하고 있는 빈다우드로카션자렐로이드 () ',' 일부 http 요청 응답 (sername) '에' 아우스그림퍼소나티 기다리고 있는, 그래서 선택취소됩니다 확보하십시오 can& # 39, t 사용합니다. 또 해킹 '$ ($ 로카시옹스파스 ()),' t work 인컨텍스트 로카시옹스파스 doesn& # 39 (아무 일도 일어나지).
또 다른 방법이 있지 않고 페이지를 다시 수동으로로 모든 요청을 다시 발행?
현재 페이지가 다시 강제로 애디슨에게, 각도 를 사용할 수 있습니다.
$route.reload();
앙굴라이스 따르면 [문서용으로] [1]:
>. 이 경우에도 현재 위치 서비스 리로드하려면 라우트를 $ $ 라우트를 hasn& # 39, t 바뀌었다. >. >. 이 범위, 그 결과로 만들어진 새로운 영비에프 라인스탄티아테스 컨트롤러입니다.
[1]: $ 라우트를 http://docs.angularjs.org/api/ngRoute/service/
그냥 다 리로드하려면 빈다우드로카션자렐로이드 사용하여 (); 앙굴라이스 함께
체크아웃하려고 apc® 예
HTML
<div ng-controller="MyCtrl">
<button ng-click="reloadPage();">Reset</button>
</div>
앙굴라이스
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
$scope.reloadPage = function(){window.location.reload();}
}
라우트를 통해
$route.reload();
스케쳐내 리로드하려면 전체 프로그램
$window.location.reload();
import { Location } from '@angular/common';
constructor(private location: Location) {}
ngOnInit() { }
load() {
this.location.reload()
}
또는
constructor(private location: Location) {}
ngOnInit() { }
Methods (){
this.ngOnInit();
}
스케쳐내 새로고치기 컨트롤러거 모든 서비스를 사용하고 동시에 이루어져야 하는데, 이 솔루션을 사용할 수 있습니다.
예:
app.controller('myCtrl',['$scope','MyService','$state', function($scope,MyService,$state) {
//At the point where you want to refresh the controller including MyServices
$state.reload();
//OR:
$state.go($state.current, {}, {reload: true});
}
이렇게 하면 HTML 도 새로고칩니다 컨트롤러 및 정보기술 (it) 또는 다시 렌더링 재생율에서 문의할 수 있습니다.
가장 쉬운 해결 방법 () 은 생각했어요
예:
대신 다음
$routeProvider
.when('/About', {
templateUrl: 'about.html',
controller: 'AboutCtrl'
})
사용,
$routeProvider
.when('/About/', { //notice the '/' at the end
templateUrl: 'about.html',
controller: 'AboutCtrl'
})
다음 중 하나를 시도하시겠습니까.
$route.reload(); // don't forget to inject $route in your controller
$window.location.reload();
location.reload();
내가 맡을게 apc® 제거하기 위한 캐시 및 리로드하지 코드 페이지
<a class="btn" ng-click="reload()">
<i class="icon-reload"></i>
</a>
인젝터: , $ $ $ $ 템플라테카치 스테파람스 스테이드, 범위,
$scope.reload = function() { // To Reload anypage
$templateCache.removeAll();
$state.transitionTo($state.current, $stateParams, { reload: true, inherit: true, notify: true });
};
다음 코드를 사용하여 사용자에게 친밀한 리로드하려면 통지용 없이. 이 페이지의 렌더링됩니다
var currentPageTemplate = $route.current.templateUrl;
$templateCache.remove(currentPageTemplate);
$window.location.reload();