0

So kinda starting out with angularjs here. I have a logincallback function which is from external login. The logincallback function would return the returnUrl and close the externallogin pop up and redirect back to the main page.

function loginCallback(success, returnUrl) {
    if (returnUrl) {
        window.location.href = returnUrl;

    } else {
        $.ajax({
            url: '@Url.Action("Index", "Home")',
            success: function (result) {
                $('/home/Login').html(result);
            }
        });
    }
}

When I identify the returnUrl I am wanting to call my injected authService from my app.js file after the logincallback so I can update my main page with updated boolean authentications.

var _authExternalProvider = function () {
    _authentication.isAuth = true;
    _authentication.userName = "";
};

I did some reading and I wasn't sure exactly how to proceed with this. Any help would be appreciated.

Julius Doan
  • 356
  • 1
  • 4
  • 20
  • http://stackoverflow.com/questions/14994391/thinking-in-angularjs-if-i-have-a-jquery-ba%E2%80%8C%E2%80%8Bckground <-- think this will help you, you shouldn't be using $.ajax you can use $http in angular for AJAX calls. – shaunhusain Sep 27 '15 at 05:09

1 Answers1

0

So all I really had to do was include call the $window in my app controller and it worked fine.

app.controller('app', function($scope, $window){
        $window.callBack= function() {
        }           
    });
Julius Doan
  • 356
  • 1
  • 4
  • 20