Importing Google contacts with angularjs
<p>I'am trying to import a user's gmail contacts using Angular Js. The code is working fine in plain javascript but giving error in angular js.</p>

<p>HTML Code..</p>

<pre><code>&lt;a class="btn btn-primary btn-simple" ng-click="importgoogle()"&gt;&lt;u&gt;Import Gmail Friends&lt;/u&gt;&lt;/a&gt;
</code></pre>

<p>Angular Code..</p>

<pre><code>   var clientId = 'Client ID';
var scopes = 'https://www.googleapis.com/auth/contacts.readonly';
   $scope.importgoogle = function(){
    window.setTimeout(authorize);       //calls authorize()
}

var authorize = function(){
    gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: false}, handleAuthorization);       //calls handleAuthorization()
}

var handleAuthorization = function(){
    if (authorizationResult &amp;&amp; !authorizationResult.error) {
            $.get("https://www.google.com/m8/feeds/contacts/default/thin?alt=json&amp;access_token=" + authorizationResult.access_token + "&amp;max-results=500&amp;v=3.0",
            function(response){
                console.log(response);
                });
        }
}
</code></pre>

<p>After entering a user's Id &amp; password the following error message is displayed in console..</p>

<pre><code>  Uncaught ReferenceError: authorizationResult is not defined
</code></pre>

<p>Can't understand where I'm going wrong as this code is working in Javascript.Please help..</p>