title: Pass JSON data from one controller to other angularjs
body: <p>I've a login service which gives me JSON object as a response having user details. Now in this response, there's an object named permissions which gives me information about the CRUD permission allowed to the user.</p>
  
  <p>It looks like this :</p>
  
  <p><a href="https://i.stack.imgur.com/ccVrA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ccVrA.png" alt="enter image description here"></a></p>
  
  <p>Now I've different pages, each page having a table. What I want is to check the permission of the logged in user and according to that show/hide the element to create/read/update/delete the record from the table.</p>
  
  <p>What I am currently doing is saving the object onto an array :</p>
  
  <pre><code>            $scope.permissionArry = [];
              for (var i = 0; i &lt; data.permissions.length; i++) {
                  $scope.permissionArry.push({
                      moduleId: data.permissions[i].module_id,
                      createModule: data.permissions[i].create_module,
                      readModule: data.permissions[i].read_module,
                      updateModule: data.permissions[i].update_module,
                      deleteModule: data.permissions[i].delete_module
                  });
               }
  </code></pre>
  
  <p>and then trying to pass this array to other controller.</p>
  
  <p>As we know we cannot pass $scope in service/factory I don't know how to proceed (I don't want to use $rootScope). </p>