I am trying to set the value in an HTML input text box which is a part of ComponentA
from the typescript code which is a part of ComponentB
.
Taking a clue from this SO i tried doing:
(<HTMLInputElement>document.getElementById("name")).value = response.name;
But this is not working. Is there anything else i need to take care of?
EDIT: The element with Id "name"
is in ComponentA and the above code that is trying to manipulate that element is in ComponentB