title: Auto focus on input filed in angular js
body: <p>I have created a directive for auto focus on text box</p>
  
  <pre><code> (function () {
  'use strict';
   angular.module('commonModule').directive('srFocuson',function(){ 
      return {
          restrict: 'A',
          require: 'ngModel',
         link: function (scope, element, attrs) {
              scope.$watch(attrs.focusMe, function (value) {
                  if (value === true) {
                      console.log('value=', value);
                     element[0].focus();
                      scope[attrs.focusMe] = false;
  
                  }
              });
          }
      };
  });
  
  })();
  </code></pre>
  
  <p>And now i want to bind that directive to my text box.I have tried to bind to input field but its not working.</p>
  
  <pre><code> &lt;input placeholder="SR ID, SSN/ITIN, or School ID" sr-focuson="focusMe" type="text"        
    id="form_ID" name="searchId" autofocus
              data-ng-model="vm.searchCriteria.searchId"
              maxlength="20" class="form-control"&gt;
  </code></pre>
  
  <p><a href="http://plnkr.co/edit/A39duXhGvCedAaVuB3uQ?p=preview" rel="nofollow">http://plnkr.co/edit/A39duXhGvCedAaVuB3uQ?p=preview</a></p>