title: Call AngularJS function on document ready
body: <p>Is there a way to call an Angular function from a JavaScript function?</p>
  
  <pre><code>function AngularCtrl($scope) {
    $scope.setUserName = function(student){  
      $scope.user_name = 'John';
    }
  }
  </code></pre>
  
  <p>I need the following functionality in my HTML:</p>
  
  <pre><code>jQuery(document).ready(function(){
    AngularCtrl.setUserName();
  }
  </code></pre>
  
  <p>The problem here is my HTML code is present when page is loaded and hence the ng directives in the html are not compiled. So I would like to <code>$compile(jQuery("PopupID"));</code> when the DOM is loaded.</p>
  
  <p>Is there a way to call a Angular function on document ready?</p>