1

I am messing with an external Angular app that I do not control. The app has several input fields and I want to fill them in programatically

document.querySelector('input[name=userEmail]').value='hello@email.com';     

The issue is that upon submission, Angular believes the inputs are empty, so I get a client-side validation error.

How can I programmatically change a field of an Angular app from outside the app?

Andrei Cioara
  • 3,404
  • 5
  • 34
  • 62

1 Answers1

1

The way you tried to manipulate input is not enough because it is not triggering angular change detection.

Check the accepted answer here: How to update a angular 4+ form values using console devtools?

talhature
  • 2,246
  • 1
  • 14
  • 28