title: How can i pass value from one angular module another Module?
body: <p>Iam New To Angular Concept Iam trying to pass an Value  from one  Module to another. 
  I Used Meanjs Generator added few more modules for every Module as per requirement .</p>
  
  <p>Example :-
  Restaurant Controller From Restaurant Module :-</p>
  
  <pre><code> angular.module('restaurants').controller('RestaurantController', ['$scope','$http','$stateParams', '$location', 'Authentication','$rootScope'
      function($scope,$http, $stateParams, $location, Authentication,$rootScope) { 
  
          $scope.create = function() {
              // Create new Restaurant object
  
             var resObj = {
                  displayName: this.displayName,
  
              var restaurant = new Restaurants(resObj);
  
              // Redirect after save
              restaurant.$save(function(response) {
                  $location.path('restaurants/'+ restaurant._id);
               **Need to Pass restaurant._id to the Menusconttoller**
              }, function(errorResponse) {
                  $scope.error = errorResponse.data.message;
              });
          }; 
  
  ]);
  </code></pre>
  
  <p><strong>I need to Pass Restaurant Id to the Menu Controller Below Is that Possible ?</strong>  </p>
  
  <pre><code>angular.module('menus').controller('MenusController1', ['$scope','$http', '$stateParams', '$location', 'Authentication'
       function($scope,$http, $stateParams, $location,Authentication) {
  
  
         // Create new Menu
          $scope.create = function () {
              $scope.isCreateloading=true;
              var menusObj= {
                  'displayName' : this.displayName
                  restaurantId  : this.restaurantId // **where i need to recieve the Id which is pased from Restaurant Controller**            
            };
  
  
      here i need to get the Id from Restaurant Module 
              $scope.menuForm=menusObj;
                  var  menu = new Menus1(menusObj);
  
                  // Redirect after save
                  menu.$save(function (response) {
                      $location.path('menus/'+menu._id);
  
                  }, function (errorResponse) {
                      $scope.error = errorResponse.data.message;
                  });
          };
  </code></pre>
  
  <p>]);</p>
  
  <p>i did $rootscope Broadcasting ,$scope.emit etc but those all examples having more controllers in  same module. Which is not suited to My Scenario.</p>
  
  <p>Please Suggest:-</p>
  
  <p>** How can i pass  id from One Module to Another Module ?** 
  <strong>Thanks For helping Novice !!</strong></p>