In angular 4, I have a component nested inside of another. The inner or the child component contains: a button, an input and a drop down list.
On the parent page, when I click on the button, both the input and the drop-down are displayed.
What is a good way to set focus of the input when clicking the button?
What I tried so far:
In the child component, I added an id on the input: <input #inputId ... >, then in the same method triggered when the button is pressed, in the child component, I added:
$('#inputId').focus();
But this has no effect...
Any suggestions?