I have an html button like so:
<button autofocus role="button" ng-disabled="something.$invalid">{{ Continue }}</button>
The button is initially disabled so the autofocus attribute doesn't have any effect. What I want to happen is when the button does get enabled, I want the focus on the button right away.
How can I accomplish this?
edit: As stated below, a directive to watch for a value then set focus to the element is one way to solve this. I've tried to create the same directives as below but focus doesn't seem to be getting set.