title: Angularjs pass value from one page to another
body: <p>In the following code i am trying to change to another page on click and want to pass the object <code>i</code> how can i do it. In the following code i get it as undefined.how to go about this</p>
  
  <pre><code>&lt;button ng-href="#/page1" value="{{i.display}}"&gt;&lt;/button&gt;
  
  app.controller("ctrls",['$scope','$location',function($scope,$location){
    $scope.func = function(i) {
      $scope.var=i
      $location.path("/rel");
    };
  ]);
  
  app.controller("ctrls",'$scope',function($scope)   {
  console.log($scope.var) //undefined
  ]);
  </code></pre>