Q:

Angular Form validator only works when typing in text box

I am developing a small app in angular5 with PHP. I have an issue in validating form. Form validator works fine when I input data by typing in keyboard. But it is not working when I fill data with javascript.
For example
In email field, 
If I type myemail , Its showing invalid email. works good.
But If I set using javascript like $('#email').value('asdsa@gmail.com') its not  working. 

What is wrong? I am new to Angular5.

A:

try to use below code for setting up the value in the form control. pleas refer angular doc for more information https://angular.io/guide/form-validation
https://angular.io/guide/reactive-forms
https://angular.io/api/forms/FormControl
this.registerForm.controls.email.setValue('asdsa@gmail.com');

