【发布时间】:2017-07-31 08:55:32
【问题描述】:
我有一个这样的路由提供者
app.config(function ($routeProvider, $locationProvider){
$locationProvider.hashPrefix('');
$routeProvider
.when('/', {
templateUrl: 'login.html',
controller: 'loginCtrl'
})
.when('/home', {
resolve:{
"check":function($location, $rootScope){
if(!$rootScope.loggedIn){
$location.path('/');
}
}
},
templateUrl:'home.html',
controller: 'homeCtrl'
})
.otherwise({
redirectTo: '/'
});
});
login.html 是我的应用程序的第一页。
但是在登录后,重新加载任何最终会出现在 login.html 页面中的页面
我希望其他页面在刷新时保持活动状态,并将 login.html 作为我的打开页面
【问题讨论】:
标签: html angularjs angular-routing route-provider