Following is my code :
var me = this;
gapi.auth.authorize({ client_id: client, scope: scope, immediate: true }, function (authResult: any) {
if (authResult && !authResult.error) {
me.accessToken = authResult.access_token;
} else {
//TODO : show error in front end
}
});
when i use callback function like this.
gapi.auth.authorize({ client_id: client, scope: scope, immediate: true }, AuthResult);
function AuthResult(authResult: any) {
if (authResult && !authResult.error) {
me.accessToken = authResult.access_token;
} else {
//TODO : show error in front end
}
I dont get the me property in that callback function
How i can wrap the callback function in other callback function where i can get the scope also in JS