Answer the question
In order to leave comments, you need to log in
Focus on input after ngShow
Hello! Can you please tell me how to do .focus()
on the input element after showing it with ngShow
?
Answer the question
In order to leave comments, you need to log in
create a directive that will do element.focus() if expression==true and pass the same expression to its attribute that is in the ng-show attribute.
For example,
<div ng-show="tab=='superheroes'">
<input type="text" data-focus-me="tab=='superheroes'" ng-model="hero.name" />
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question