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?
angular.module('ctrl').controller('MyCtrl', ["$scope","$rootScope", function($scope, $rootScope){
$rootScope.submitDetails=function()
}]);//inside app.js
clickApply: function(e) { //inside datepicker.js
angular.element('#span').on("click",submitDetails());
this.hide();
this.element.trigger('apply.daterangepicker', this);
}