0
Help!私はそれを停止する方法を知りたいですか?角度ui-router & angularFireを使用した後、無限大ダイジェストループに問題があります。私はループが$ stateChangeStartに落ち続けていることがわかりました。ここに私のコンソールログがあります。AngularFire認証のAngularjs inifinityダイジェストループ
1476969257159 Start: {} -> dashboard{}
Auth errorAUTH_REQUIRED
1476969259545 Start: {} -> login{}
1476969260671 Start: {} -> dashboard{}
Auth errorAUTH_REQUIRED
1476969263828 Start: {} -> login{}
1476969266255 Start: {} -> dashboard{}
Iコード私のUI-ルータこうして私が持っている
$rootScope.$on("$stateChangeError",function (ev,toSt,toPa,fromSt,fromPa,error) {
// We can catch the error thrown when the $requireSignIn promise is rejected
console.log("Auth error" + error);
if (error === "AUTH_REQUIRED") {
$state.go("login");
}
});
そして
$urlRouterProvider
.when('/', '/dashboard')
.when('','/')
.otherwise('/404');
アメリカ、
$stateProvider
.state('dashboard', {
url: '/dashboard',
controller: 'dashboardCtrl',
templateUrl: 'templates/dashboard/dashboard.html'
resolve: {
// controller will not be loaded until $requireSignIn resolves
// Auth refers to our $firebaseAuth wrapper in the factory below
"currentAuth": ["wifAuth", function(wifAuth) {
// console.log ("dashboard check");
// $requireSignIn returns a promise so the resolve waits for it to complete
// If the promise is rejected, it will throw a $stateChangeError (see above)
return wifAuth.$requireSignIn();
}]
}
})
.state('login',{
url: '/login',
templateUrl: 'templates/auth/login.html',
resolve: {
// controller will not be loaded until $waitForSignIn resolves
// Auth refers to our $firebaseAuth wrapper in the factory below
"currentAuth": ["wifAuth", function(wifAuth) {
// console.log ("login check");
// $waitForSignIn returns a promise so the resolve waits for it to complete
return wifAuth.$waitForSignIn();
}]
}
})