I have an angular app based on the angularjs/php authentication sample. Due to some reason, login only occurs if I click the login button in rapid succession for about four times. But if we use the developer tool, we can see that in the back end the authentication is successful in the first click itself, but the view doesn't update.
Anybody have faced such an issue? Any help would be much appreciated.
Edit: It looks like if i change the setTimeout value to 2000 it logs in, in just 1 click. If the value is reduced, it takes a lot of fast clicks.
setTimeout(function() {
principal.authenticate($scope.details);
if ($scope.returnToState)
$state.go($scope.returnToState.name, $scope.returnToStateParams);
else $state.go('home');
}, 2000);