forgetPassword.controller.js
776 Bytes
(function() {
'use strict'
angular.module('acufuel')
.controller('forgetPasswordController', [ '$scope', '$state', 'forgetPasswordService', forgetPasswordController]);
function forgetPasswordController($scope, $state, forgetPasswordService) {
$scope.forgetPassword = function(email) {
forgetPasswordService.recoverpassword(email).then(function(result){
if(typeof result == 'object') {
toastr.info("Password generated successfully. Please check your email for new password");
localStorage.setItem('requiredChangePwd', "Y");
$state.go('login');
} else {
toastr.info("Error in generating password");
}
})
}
}
})();