title: Call a function from one module to another module
body: <p>I have two angularjs file. I have created some function inside a controller.Now I want to call this function from another module and controller.I tried by injecting the module dependency into my caller module .But it is not recognizing the function.I am new in angularjs.</p>
  
  <p>This is the module I want to call</p>
  
  <pre><code>var app = angular.module("demo", []);
          app.controller("testCtrl", function($scope,$http,$window) {
             $scope.temp = "";
             $scope.rows = []; // init empty array
             $scope.datainput =[];
             $scope.dataconfig =[];
  
              $scope.myrunner=function(canvasid,inputdata,configdata){
  
                  var flag=0;
                  $scope.datainput=inputdata;
                  $scope.dataconfig=configdata;
                  console.log("from base module");                
              }
  
              $scope.refresh = function(){
                  location.reload();              
              }
          });
  </code></pre>
  
  <p>This is the caller module</p>
  
  <pre><code>var app = angular.module("tester", ["demo"]);
      app.controller("mycontroller", function($scope) {
  
  
          var input=[{"status":"PAY_FAIL","value":6248},{"status":"PAY_SUCCESS","value":868},{"status":"PM_REQUESTED","value":11199},{"status":"PAY_INIT","value":992}] ;
  
  
          var config=[
          {"type":"font_name","value":"Calibri"},
          {"type":"font_size","value":"25px"}
          ] ;
  
  
          $scope.myfn=function(){
  
  
  
              demo.myrunner('myCanvas',input,config);
              demo.myrunner('myCanvas2',input,config);
          }
  
  
          $scope.myfn();
  
  });
  </code></pre>