title: How to re-run/reload a section of a controller?
body: <p>In the following Angular controller, the <code>$q.all</code> gets a JSON tree which is saved in <code>$scope.building</code>. <code>$scope.building</code> is then used to create <code>pano</code>'s and <code>panodata</code>'s:</p>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>angular.module('yoApp')
    .controller('addPanoCtrl', function($q, $scope, $rootScope, $routeParams, serviceUpload) {
      $scope.buildingId = $routeParams.buildingId
  
      $q.all([
        serviceUpload.getAllBuilding()
      ]).then(function(value) {
        var buildingJSON = _.where(JSON.parse(value), {'objectId': $scope.buildingId})
        $scope.building = buildingJSON[0]
      }, function(reason) {
        $scope.result = reason
      })
  
      // Methods
  
      $scope.addPano = function() {
        // SOME CODE
        pano.save(json, {
      success: function(object) {
        $scope.building.pano.push(json)
        $scope.panoName = ''
        $scope.$digest()
      },
      error: function(object, error) {
      }
        })
      }
  
      $scope.addPanodata = function(panoId) {
        // SOME CODE
        panodata.save(json, {
      success: function(object) {
        $scope.pano.panoData.push(json)
        $scope.panodataName = ''
        $scope.$digest()
      },
      error: function(object, error) {
      }
        })
      }
    })
  </code></pre>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>   &lt;div class="col-md-3" ng-repeat="pano in building.pano"&gt;
      &lt;!-- SOME CODE --&gt;
      &lt;a class="btn btn-primary" href="javascript:;" ng-click="addPanodata(pano.objectId)"&gt;Add&lt;/a&gt;
  </code></pre>
  
  <p>Saving <code>pano</code>'s has no problem since I have <code>$scope.buildingId</code>. The problem arises when I save a <code>panodata</code>. If I create a <code>pano</code> and then a <code>panodata</code> I can't since <code>$scope.building</code> doesn't have the new <code>pano</code>.</p>
  
  <p>The <code>panodata</code> is saved if I reload the page, but I was thinking if there's away to reload only the <code>$q.all</code> bit so <code>$scope.building</code> get's fetched again with the newly created <code>pano</code>.</p>
  
  <p>What's the common way to accomplish this in AngularJS?</p>