Created
September 15, 2014 06:24
-
-
Save wgallios/b6e3d667172c3ccdb4e2 to your computer and use it in GitHub Desktop.
AngularJS Directive to select all on-click for an input
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
app.directive('selectOnClick', function () { | |
return { | |
restrict: 'A', | |
link: function (scope, element, attrs) { | |
element.on('click', function () { | |
this.select(); | |
}); | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment