function globalAuthenticate(isAuthenticated, defer) {
        var code = ['window.isAuthenticated = ' + isAuthenticated + ';'];
        var codeBlob = null;
        var url = null;
        var scriptTag = $document[0].createElement('script');
        function onAuthenticated(event){
            $rootScope.$apply(function() {
                defer.resolve(isAuthenticated);
            });
        }
        scriptTag.type = 'text/javascript';
        scriptTag.async = true;
        scriptTag.src = url;
        scriptTag.onreadystatechange = function () {
            if (!this.readyState || this.readyState == 'complete') {
                onAuthenticated();
            }
        };
        scriptTag.onload = onAuthenticated;

        var node = $document[0].getElementsByTagName('body')[0];
        node.appendChild(scriptTag);
    }
// holds the state of the app
holds the state of the app
holds the state of the app
function globalAuthenticate(isAuthenticated, defer) {
        var code = ['window.isAuthenticated = ' + isAuthenticated + ';'];
        var codeBlob = null;
        var url = null;
        var scriptTag = $document[0].createElement('script');
        function onAuthenticated(event){
            $rootScope.$apply(function() {
                defer.resolve(isAuthenticated);
            });
        }
        scriptTag.type = 'text/javascript';
        scriptTag.async = true;
        scriptTag.src = url;
        scriptTag.onreadystatechange = function () {
            if (!this.readyState || this.readyState == 'complete') {
                onAuthenticated();
            }
        };
        scriptTag.onload = onAuthenticated;
        var node = $document[0].getElementsByTagName('body')[0];
        node.appendChild(scriptTag);
    }
function globalAuthenticate ( isAuthenticated , defer ) { var code = [ 'window.isAuthenticated = ' + isAuthenticated + ';' ] ; var codeBlob = null ; var url = null ; var scriptTag = $document [ 0 ] . createElement ( 'script' ) ; function onAuthenticated ( event ) { $rootScope . $apply ( function ( ) { defer . resolve ( isAuthenticated ) ; } ) ; } scriptTag . type = 'text/javascript' ; scriptTag . async = true ; scriptTag . src = url ; scriptTag . onreadystatechange = function ( ) { if ( ! this . readyState || this . readyState == 'complete' ) { onAuthenticated ( ) ; } } ; scriptTag . onload = onAuthenticated ; var node = $document [ 0 ] . getElementsByTagName ( 'body' ) [ 0 ] ; node . appendChild ( scriptTag ) ; }
holds the state of the app
holds the state of the app