I have an html page with html elements and my own custom component(which is a dropdown) created in angular 2. as:
<div>
<input type="text" name="fname"><br>
<myDropdownComp autofocus> </myDropdownComp>
</div>
On pageload, focus should be on my custom dropdown component. How can I do that? I tried giving 'autofocus' which is not working. Please help. Thanks in advance.
myDropdownCompyou will need to write the custom logic inngOnInitfor element focus.