title: Passing data from one page to another in angular js
body: <p>How do I pass data from one page to another in angular js?
  I have heard about using something as services but I am not sure how to use it!
  Given below is the functionality I want to execute!
  On page 1:</p>
  
  <pre><code>&lt;div class="container" ng-controller="mycontrl"&gt;
    &lt;label for="singleSelect"&gt; Select Date &lt;/label&gt;&lt;br&gt;
    &lt;select nAMe="singleSelect" ng-model="dateSelect"&gt;
      &lt;option value="2/01/2015"&gt;2nd Jan&lt;/option&gt;
      &lt;option value="3/01/2015"&gt;3rd Jan&lt;/option&gt;  
    &lt;/select&gt;
    &lt;br&gt;
    Selected date = {{dateSelect}}
    &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;
    &lt;label for="singleSelect"&gt; Select time &lt;/label&gt;&lt;br&gt;
    &lt;select nAMe="singleSelect" ng-model="timeSelect"&gt;
      &lt;option value="9/10"&gt;9AM-10AM&lt;/option&gt;
      &lt;option value="10/11"&gt;10AM-11AM&lt;/option&gt;
      &lt;option value="11/12"&gt;11AM-12PM&lt;/option&gt;
      &lt;option value="12/13"&gt;12PM-1PM&lt;/option&gt;
      &lt;option value="13/14"&gt;1PM-2PM&lt;/option&gt;
    &lt;/select&gt;
    &lt;button ng-click="check()"&gt;Check!&lt;/button&gt;
    &lt;br&gt;
    Selected Time = {{timeSelect}}
    &lt;br/&gt;&lt;br/&gt;
  </code></pre>
  
  <p>User selects time and date and that is used to make call to the db and results are stored in a variable array!
  Page 1 controller:</p>
  
  <pre><code>var config= {
    params: { 
      time: times,
      date:dates
    }
  };
  
  $http.get('/era',config).success(function(response) {
    console.log("I got the data I requested");
    $scope.therapist_list = response;
  });
  </code></pre>
  
  <p>Now how do I send this variable <code>$scope.therapist_list</code> which is an array to next page which will be having a different controller and also if services is use how do define it in my application.js file</p>
  
  <p>application.js:  </p>
  
  <pre><code>var firstpage=angular.module('firstpage', []);
  var secondpage=angular.module('secondpage', []);
  </code></pre>