如何通过重新加载来重新加载 Angular 解析?
我的代码:
.when('/dashbord', {
title: 'dashbord',
templateUrl: 'views/dashbord.php',
controller: 'dashbordController',
resolve: {
getDashbord: function (getDashbordService) {
return getDashbordService;
}
}
})
重新加载功能:
app.run(['$rootScope', '$route', '$templateCache', function ($rootScope, $route, $templateCache) {
$rootScope.changeRoute = function(){
var currentPageTemplate = $route.current.templateUrl;
$templateCache.remove(currentPageTemplate);
$route.reload();
};
}]);
上述函数仅重新加载 View 。它不会重新加载解析。
我怎样才能以 Angular 来做到这一点?
最佳答案
关于javascript - 同一路线重新加载时的 Angular 解析重新加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35488227/