Created
October 8, 2015 18:06
-
-
Save vaporic/165756bfadb53d7053e0 to your computer and use it in GitHub Desktop.
Autofocus AngularJ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.directive('autoFocus', function($timeout) { | |
return { | |
restrict: 'AC', | |
link: function(_scope, _element) { | |
_element[0].focus(); | |
} | |
}; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment