title: AngularJS : access deferred promise from new template
body: <p>I'm new to angular and LOVE it...coming from a 10 yr PHP background there is a lot of new terms for me. 
  Here is what I would like to-do, not sure if it's possible, if yes, not sure how. I have created a list of properties and <strong>that part works fine</strong>. the list shows limited details of each property and all the details are available for a detailed view.</p>
  
  <p>So my question is how to access that data by id without hitting the DB again and showing in a new template for a detailed view?</p>
  
  <p>Here is the code I have so far:</p>
  
  <pre><code>propApp.controller('propertyCrtl', function ($scope, $routeParams, $timeout, getProperty ) {
  
    var promise = getProperty.getList();
    promise.then(function(data){
      $scope.list = data.data.listings;
      $scope.id = $routeParams.prop_id;
      $scope.currentPage = 1; //current page
      $scope.entryLimit = 20; //max no of items to display in a page
      $scope.filteredItems = $scope.list.length; //Initially for no filter
      $scope.totalItems = $scope.list.length;
      //console.log(data.data.listings);
    })
  </code></pre>
  
  <p>and the service</p>
  
  <pre><code>propApp.service('getProperty', function($http, $q){
  
  var deferred = $q.defer();
  $http.get('wp-content/themes/wp-angular-theme/ajax/getProperty.php')
  .then(function(data){
    deferred.resolve(data);
  });
  
  this.getList = function(){
    return deferred.promise;
  }
  
  this.getById = function(id){
    return deferred.promise;
  } 
  
  })
  </code></pre>
  
  <p>Any help would be appreciated...Thanks for looking.</p>