我想在用户注销后重定向到主页
$rootScope.logOut = function () {
myService.logOut().then(function (data) {
$rootScope.$apply(function () {
$location.path("/");
});
});
}
但是它生成
$digest已经在进行中
错误。
尝试使用$timeout
$rootScope.logOut = function () {
myService.logOut().then(function (data) {
$timeout(function(){
$location.path("/");
});
});
}