title: ng-model is not updating when using jquery element.val()
body: <p><a href="http://plnkr.co/edit/E4RQpZ0TYytmOolHd5ME?p=preview" rel="nofollow">PLUNKR example here</a></p>
  
  <p>I'm using some version of jquery autocomplete as an angularjs direcitve. 
  When the jquery updates the input's value using <code>element.val()</code> angular does no notice the change until after the next digest ( i suppose ).</p>
  
  <p>My first thought was to perform the action on the <code>ng-model</code> post digest using <code>$timeout</code> but as you can see it didn't help.</p>
  
  <p>My second approach was to override the element's <code>val</code> function to trigger an <code>input</code> event but I haven`t managed to make it work. </p>
  
  <p>Try to select a value from the autocomplete list and you'll see that the ng-model above is not updating.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Thanks for the response. I didn't know about the <code>onSelect</code> option. </p>
  
  <p>This is the code based on your recommendations</p>
  
  <pre><code>// clone user provided options 
  scope.options = _.extend({}, scope.AutoCompleteOptions());
  
  // Wrap onSelect - Force update before manipulation on ng-model
  var fn = _.has(scope.AutoCompleteOptions(), 'onSelect')  ? scope.AutoCompleteOptions().onSelect : _.noop;
  scope.options.onSelect = function () { 
    ngModelCtrl.$setViewValue(element.val()); 
    scope.$apply(fn);
  };
  
  scope.autocomplete = $(element).autocomplete(scope.options);
  </code></pre>
  
  <p>This way i maintain the interface of the directive while guarantying that <code>ng-model</code> will be up to date. </p>
  
  <p>Thanks.</p>