title: Calling Angularjs Function from a different javascript/Jquery Function
body: <p>I have two js files, app.js and datepicker.js. I have nothing to do with the html file here. There is a javascript function called clickApply() in datepicker.js. I want to call another submitDetails() function which is inside the app.js file from the clickApply() function. How to do it?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>angular.module('ctrl').controller('MyCtrl', ["$scope","$rootScope", function($scope, $rootScope){
                  
  $rootScope.submitDetails=function() 
  }]);//inside app.js</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>clickApply: function(e) { //inside datepicker.js
              
               angular.element('#span').on("click",submitDetails());
            
              this.hide();
              this.element.trigger('apply.daterangepicker', this);
  
          }</code></pre>
  </div>
  </div>
  </p>