title: How can I determine when ng-options has finished updating the DOM?
body: <p>I'm trying to implement the jQuery multiselect plugin using a directive inside my app. Here' the select element:</p>
  
  <pre><code>&lt;select multiple 
          ng-model="data.partyIds" 
          ng-options="party.id as party.name for party in parties" 
          xs-multiselect="parties"&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>The model <code>parties</code> model is loaded through $http. The multiselect plugin parses the <code>option</code> elements inside the <code>select</code> and generates the nice multi select. </p>
  
  <p>Is there a way to detect when the <code>select</code> element is populated with options so I can tell the multiselect plugin to update its data?</p>
  
  <p>Here's my directive:</p>
  
  <pre><code>machineXs.directive("xsMultiselect", function() {
      return {
          restrict: "A",
          require: '?ngModel',
          link: function(scope, element, attrs, ngModel) {
              element.multiselect().multiselectfilter();
              scope.$watch(scope[attrs["xsMultiselect"]], function() {
                  // I tried watching but it doesn't help
                  element.multiselect('refresh');
                  element.multiselectfilter("updateCache");
              });
          }
      }
  });
  </code></pre>