title: How to call a JQuery function from AngularJS when a view is changed
body: <p>I'm new to AngularJS, and I'm dealing with a problem while implementing <a href="http://manos.malihu.gr/jquery-custom-content-scroller/">jQuery custom content scroller</a> into my application.</p>
  
  <p>I need the scroller to update, when I update the content with Angular, for this the scroller has an <code>update</code> method. My problem is, that I don't know where to call it. The markup for the content is the following:</p>
  
  <pre><code>&lt;div class="scroll-list nice-scrollbars"&gt;
      &lt;ul class="gallery clearfix"&gt;
          &lt;li class="extra-alt" ng-repeat="item in relatedItems.data"&gt;
              ...
          &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I was trying to call the update method in success branch of Angular's <code>$http.post</code>:</p>
  
  <pre><code>$scope.relatedItems = $http.post($scope.url, {
      'filterType': 'related', 'film': id
  }).success(function() {
      $(".nice-scrollbars").mCustomScrollbar('update');
  });
  </code></pre>
  
  <p>This didn't work, I think it's because when the success method is called, the view content is not updated yet (I could see it using an <code>alert</code> function, the data appeared after closing the dialog box)</p>
  
  <p>The only way I was able to make the scrollbars work was using the scroller's advanced property for watching the changes in the content (these are the options passed to the scrollbar):</p>
  
  <pre><code>var scrollbarOpts = {
      scrollButtons:{
          enable:true
      },
      advanced:{
          updateOnContentResize: true
          //@TODO: get rid of this, correctly find where to call update method
      }
  }
  </code></pre>
  
  <p>This is bad practice, as this options reduces the performance of the whole script. 
  <strong>I would like to know, where is the correct place to call jQuery methods needed to update DOM as needed, or how is such binding to view changes done correctly in AngularJS?</strong></p>