title: Angularjs: Select and focus of an element in directive link
body: <p>I'm trying to get a text input field selected and focused from the beginning with my custom directive.</p>
  
  <p>Input Field:</p>
  
  <pre><code>&lt;input type="text" value="Preset Value" select-on-load /&gt;
  </code></pre>
  
  <p>Custom Directive:</p>
  
  <pre><code>app.directive('selectOnLoad', function () {
  // Linker function
  return {
      restrict: 'A',
      link: function (scope, element, attrs) {
          element.focus().select();
      }
  };
  </code></pre>
  
  <p>});</p>
  
  <p>But I only get a javscript error saying that focus/select is not a function.
  How else should I do that?</p>