www/app/components/user/controllers/userProfileChangePasswordController.js
/**
         * @desc Close the modal with promise.resolve state
         * @function _ok
         * @param {bool} formIsValid Passed from view, is a valid form angular boolean
         * @memberOf Controllers.UserProfileChangePasswordController
         */
@desc Close the modal with promise.resolve state
@function _ok
@param {bool} formIsValid Passed from view, is a valid form angular boolean
@memberOf Controllers.UserProfileChangePasswordController
@desc Close the modal with promise . resolve state @function _ok @param { bool } formIsValid Passed from view is a valid form angular boolean @memberOf Controllers . UserProfileChangePasswordController
function _ok(formIsValid) {
            if (formIsValid) {
                if (_passwordAndConfirmationIsEqual()) {
                    var promise = authenticateWebApi.checkIfThisPasswordIsGood($scope.userInput.holdPassword)
                        .then(function () {
                            promise = authenticateWebApi.changePassword({
                                holdPassword: $scope.userInput.holdPassword,
                                newPassword: $scope.userInput.newPassword
                            });
                            promise.then(function () {
                                $modalInstance.close();
                            }, function (message) {
                                $modalInstance.dismiss({canceled: false, message: message});
                            });
                        }, function (message) {
                            $modalInstance.dismiss({canceled: false, message: message});
                        });
                } else {
                    toastr.warning('Les mots de passe ne correspondent pas.');
                }
            }
        }
function _ok ( formIsValid ) { if ( formIsValid ) { if ( _passwordAndConfirmationIsEqual ( ) ) { var promise = authenticateWebApi . checkIfThisPasswordIsGood ( $scope . userInput . holdPassword ) . then ( function ( ) { promise = authenticateWebApi . changePassword ( { holdPassword : $scope . userInput . holdPassword , newPassword : $scope . userInput . newPassword } ) ; promise . then ( function ( ) { $modalInstance . close ( ) ; } , function ( message ) { $modalInstance . dismiss ( { canceled : false , message : message } ) ; } ) ; } , function ( message ) { $modalInstance . dismiss ( { canceled : false , message : message } ) ; } ) ; } else { toastr . warning ( 'Les mots de passe ne correspondent pas.' ) ; } } }
@desc Close the modal with promise.resolve state
 @function _ok
 @param {bool} formIsValid Passed from view, is a valid form angular boolean
 @memberOf Controllers.UserProfileChangePasswordController
@desc Close the modal with promise . resolve state @function _ok @param { bool } formIsValid Passed from view is a valid form angular boolean @memberOf Controllers . UserProfileChangePasswordController