Wanted to convert following service to Angular 2 Service. I am using google api here. The main problem I am getting is to returning the Promise as its not similar as Angular 1.x.
getLoginStatus: function () {
var deferred = $q.defer();
gapi.auth.authorize({client_id: dataStore.getData('CLIENT_ID'), scope: dataStore.getData('SCOPES'), immediate: true},function(response){
var res = {};
res = response;
deferred.resolve(res);
});
return deferred.promise;
}