autoFocus.js 352 B

1234567891011121314
  1. (function () {
  2. 'use strict';
  3. angular.module('ariaNg').directive('ngAutoFocus', ['$timeout', function ($timeout) {
  4. return {
  5. restrict: 'A',
  6. link: function (scope, element) {
  7. $timeout(function () {
  8. element[0].focus();
  9. });
  10. }
  11. };
  12. }]);
  13. }());