Created
February 1, 2016 13:37
-
-
Save alexkoretzki/f2189c9b35cb39b3fe62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
state('main', { | |
url:"/main", | |
resolve:{ | |
Fblogin: function($q){ | |
var q= $q.defer(); | |
FB.getLoginStatus(function(response) { | |
if (response && response.status === 'connected') { | |
q.resolve('ok'); | |
} | |
if( response.status === 'unknown' ){ //user loged out in facebook and website system | |
q.reject('not ok'); | |
} | |
}); | |
return q; | |
}, | |
controller:function($scope,$state,Fblogin,haveSession){ | |
$scope.promise= Fblogin; | |
//console.log($scope.promise.promise); | |
$scope.promise.promise.then(function(succsess){ | |
console.log(succsess); | |
},function(error){ | |
console.log(error); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment