2017-02-07 13:34:26 +00:00
|
|
|
import {module} from '../module';
|
2017-01-31 13:13:06 +00:00
|
|
|
|
2017-02-07 13:34:26 +00:00
|
|
|
/**
|
|
|
|
* Sets the focus and selects the text on the directive element.
|
|
|
|
*/
|
2017-01-31 13:13:06 +00:00
|
|
|
export function directive() {
|
|
|
|
return {
|
|
|
|
restrict: 'A',
|
|
|
|
link: function($scope, $element, $attrs) {
|
|
|
|
var input = $element[0];
|
|
|
|
input.focus();
|
|
|
|
input.select();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
module.directive('vnFocus', directive);
|