(function() { "use strict"; angular.module('shared') .directive('setFocus', ['$timeout', function($timeout){ return{ scope: {setFocus: '='}, link: function(scope, element){ $timeout(function() { if (scope.setFocus) { element[0].focus(); } }) } } }]) })();