Yes I am sending email in resetPassword() function. Here is my fuction :
.controller('ResetCtrl', ['$scope', '$state', '$firebaseAuth', '$cordovaOauth', '$ionicLoading', function($scope, $state, $firebaseAuth, $cordovaOauth,$ionicLoading) {
var fb = new Firebase("https://myapp.firebaseio.com/");
var fbAuth = $firebaseAuth(fb);
$scope.login = function() {
$state.go('authentication');
}
$scope.register = function() {
$state.go('signup');
}
$scope.user = {
email: ''
};
$scope.errorMessage = null;
$scope.resetPassword = function() {
$scope.errorMessage = null;
$ionicLoading.show({
template: 'Please wait...'
});
fbAuth.sendPasswordResetEmail($scope.email)
.then(showConfirmation)
.catch(handleError);
};
function showConfirmation() {
$scope.emailSent = true;
$ionicLoading.hide();
};
function handleError(error) {
switch (error.code) {
case 'INVALID_EMAIL':
case 'INVALID_USER':
$scope.errorMessage = 'Invalid email';
break;
default:
$scope.errorMessage = 'Error: [' + error.code + ']';
}
$ionicLoading.hide();
}
}])
But I don't know why email is not sending.