Join the Stack Overflow Community
Stack Overflow is a community of 6.6 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I am trying to call onclick function when i login through gmail,i wrote 2 functions below on which when i login through gmail it gets back to this controller but refreshing 2 times because of that my storage is getting empty and unable to open modal.Can anyone please help me.Thanks.

$scope.onClick = function(data) {
    if(storage.getItem('isSupportClicked')) {
        $('#alert').modal('show');
        storage.remove('isClicked');
    } else {
        storage.setItem('isClicked', true);
    }
};
supportAfterLogin();
function supportAfterLogin() {
    if(storage.getItem('onClick')) {
        $scope.onClick();
    }
}
share|improve this question
1  
Put your supportAfterLogin() call after you create the function. – Tom Johnson Jan 4 at 12:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.