"use strict";

angular.module("hikeio").
	directive("giveFocus", function() {
	return {
		link: function(scope, element, attributes) {
			scope.$watch(attributes.giveFocus, function(value) {
				if (value) {
					setTimeout(function() {
						element.focus();
					});
				}
			});
		}
	};
});
"use strict";

angular.module("hikeio").
	directive("giveFocus", ["$timeout", function($timeout) {
	return {
		link: function(scope, element, attributes) {
			scope.$watch(attributes.giveFocus, function(value) {
				if (value) {
					$timeout(function() {
						element.focus();
					});
				}
			});
		}
	};
}]);
Use angular timeout directive instead of setTimeout.
Use angular timeout directive instead of setTimeout.
