Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Apache server email exists check with ionic 2

$
0
0

@ismailcse11 wrote:

form validation from apche server using http

this.authForm = fb.group({
'email' : [null, Validators.compose([Validators.required, EmailExists.existsEmail ])]

		})

email validator

export class EmailExists {

static existsEmail(fc: FormControl): ValidationResult } {

		let headers = new Headers();
		headers.append('Content-Type', 'application/x-www-form-urlencoded');
		let data='email='+fc.value;

		http.post('http://localhost/shirtmela/API/registration_email_check.php',data,{headers: headers})
		.map(res => res.json())
		.subscribe(data => {

			let posts = data.msg;
			if(posts=='success'){
				return ({existsEmail: true});
			}else{
				return (null);
			}
		}, (err) => {

			return (null);
		});
}

}

How can i solve this problem using static method. Thanks in advance.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>