title: $emit + $on / $broadcast + $on are not working in AngularJS
body: <p>I need to call function in another controller in angular js.How it is possible way please help me and i used below code but its not working please help me someone </p>
  
  <h2>EmployeeCtrl</h2>
  
  <pre><code>routerApp.controller('EmployeeController', function ($scope, $rootScope) {
          $rootScope.$on("CallSearchtMethod", function (searchName) {
              $scope.parentmethod(searchName);
          });
          $scope.parentmethod = function (searchName) {
              console.log("data is" + searchName);
          }
      }
  })
  </code></pre>
  
  <h2>NavCtrl</h2>
  
  <pre><code>routerApp.controller('navCtrl', function ($scope,$rootScope ) {    
     $scope.searchFun = function (searchName) {
        $rootScope.$emit("CallSearchtMethod", searchName);
      }
  })
  </code></pre>