saBootstrapValidator in Angular

See All Questions HereCategory: AngularJS version (1.8.x)saBootstrapValidator in Angular
toti1972 asked 11 months ago

I’m using forms with¬†saBootstrapValidator and I’m trying to validate if an email exists through an ajax call to server. This is my validator array. Even when I use an email that is valid (in console it appears the message) the forms show the error message saying that the mail already exists. Any idea of what is bad in the validator?

validatorOptions = {
        fields: {
            user_mail: {
                validators: {
		    emailAddress: {
                        message: 'The value is not a valid email address'
                    notEmpty: {
                        message: "Please enter user's email"
		    callback: {
			message: 'Mail already exists in database',
			callback: (value, validator, $field) => {
			// Parameters obj-
			var fd = new FormData();
			return (, fd )
			.map((response: Response) => {
				// login successful if there's a jwt token in the response
				let mailexists = response.json() && response.json().content && response.json().content.mailexists;
				let mailiscorrect = !mailexists;
				console.log('Mail is correct?');
				return mailiscorrect;
				data => {
					if (!data) 
						console.log('Mail already exists');
						console.log('Mail is correct');
					return data
				err => {
				() => { 


Thank you

0 Answers
MyOrange Staff answered 3 years ago


Leave a Reply