我想用$rout来做
$scope.reloadRoute = function() {
$route.reload();
};在我发现的所有示例中,我需要加载ngRoute模块,因此我在index.html中添加了angular-route.min.js,并添加了ngRoute
var app = angular.module('gifts_and_parties', ['smart-table','ngRoute'])但之后我的应用就崩溃了。
发布于 2017-01-19 17:41:07
问题可能是您没有在controller中注入$route,还要检查您的index.html中是否包含了angular-route
Mypp.controller('Ctrl', [
'$scope', '$route',
function($scope,$route) {
$route.reload();
};
}
]);其次,如果您希望重新加载整个页面,则可能需要使用$window.location.reload();
https://stackoverflow.com/questions/41738289
复制相似问题