frontend: add autofocus directive

This commit is contained in:
nemunaire 2018-01-17 00:05:50 +01:00
parent 9d4c048f0e
commit 5b2dc909e2

View File

@ -7,6 +7,18 @@ String.prototype.capitalize = function() {
); );
} }
angular.module("FICApp")
.directive('autofocus', ['$timeout', function($timeout) {
return {
restrict: 'A',
link : function($scope, $element) {
$timeout(function() {
$element[0].focus();
});
}
}
}]);
angular.module("FICApp") angular.module("FICApp")
.filter("capitalize", function() { .filter("capitalize", function() {
return function(input) { return function(input) {