export function SelectAllOnClickDirectiveFactory() { return new SelectAllOnClickDirective(); } class SelectAllOnClickDirective implements angular.IDirective { restrict = 'A'; link = (scope: ng.IScope, element: ng.IAugmentedJQuery) => { let focusedElement: any; element.on('click', function() { if (focusedElement != this) { this.select(); focusedElement = this; } }); element.on('blur', function() { focusedElement = null; }); } }