I'm currently working on an Angular application. In one particular scenario, when a user attempts to change their password, a service call is made that will return multiple error messages in a single response if the password change was unsuccessful. The response looks something like this:
Password should meet the policy. Previous password cannot be reused. Both New and Confirm passwords should match. Password is too short.
How can I insert a new line after each period (.) so that I can display the error messages on separate lines rather than together?
JavaScript Code
function (errorData) {
$ctrl.errorMessage = errorData.data.error;
$mdToast.show(
$mdToast.simple()
.textContent($ctrl.errorMessage)
.hideDelay(3000)
);
});