I'm trying to update the value which is an input of Angular component by clicking on button which not a part of the Angular Element. How can I update the value in the Angular Elements in order to display in the UI?
HTML Code
<second-hello test="First Value"></second-hello> // This is a Web Component by Angular
<button onclick="change()">Change</button> // This button is part of the Vanilla JS Application. This is not a part of the Angular Component
JavaScript Code:
function change() {
console.log(document.querySelector('second-hello').getAttribute('test'));
document.querySelector('second-hello').setAttribute('test', 'New Test worked');
console.log(document.querySelector('second-hello').getAttribute('test'));
}
// Above JS function changes the value and that can be seen in browser console but it does not update in UI