In my view
<button type="button"
ng-disabled="isProcessing"
ng-click="login.ssoFacebook()"
class="button button-primary">
<span class="icon icon-social-facebook"></span>
Login Using Facebook
</button>
When I click the button facebook doesn't work My controller
this.ssoFacebook = function(){
// intiate
ssoAuth.facebook.initiate()
.then(function(customer){
if (!customer) throw 'error system';
authService.setCurrentSession(customer, $scope);
$timeout(function() {
$scope.$emit(GLOBAL_EVENTS.SYSTEM.ACCOUNT.SESSION.LOGIN_SUCCESS);
}, 500);
// redirect or something
$state.go('products', {}, {reload: true});
})
.catch(function(error){
$scope.$emit(GLOBAL_EVENTS.SYSTEM.ACCOUNT.SESSION.LOGIN_FAILED, error);
});
};
Am I doing something wrong? thanks advance
loginin html? For woking like this with controller somewhere above you should declareng-controller="Mycontroller as login"