Skip to content

Instantly share code, notes, and snippets.

@45kb
Forked from typesafe/tabindex directive
Last active August 29, 2015 14:10
Show Gist options
  • Save 45kb/af8cd3061ed6c4580a72 to your computer and use it in GitHub Desktop.
Save 45kb/af8cd3061ed6c4580a72 to your computer and use it in GitHub Desktop.
MyModule.directive('tabindex', function () {
return {
restrict: 'A',
link: function (scope, elem, attr, ctrl) {
if (attr.tabindex == 1) {
elem.focus();
}
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment