I have places in my code where I have this:
I would like to be able to use it like
Create a directive like this
.directive('autoFocus', ['$timeout', function ($timeout) { return { restrict: 'A', link: function ($scope, $element) { $timeout(function () { $element[0].focus(); }); } }