According to comments in Angular2 and jQuery 'change' events, the following can be used to trigger change event for an input field:
const customEvent = document.createEvent('Event');
customEvent.initEvent('input', true, true);
$('#input1')[0].dispatchEvent(customEvent);
But this does not seem to work for password input field. How to make it work for password field?