title: Error dealing with $q.all and promises in AngularJS
body: <p>Given the following code:</p>
  
  <pre><code>function Ctrl($scope, $http, $q) {
    var search = function(name) {
      if (name) {
        $http.get('http://api.discogs.com/database/search?type=artist&amp;q='+ name +'&amp;page=1&amp;per_page=5').
          success(function(data3) {
            $scope.clicked = false;
            $scope.results = data3.results;
          });
      }
      $scope.reset = function () {
        $scope.sliding = false;
        $scope.name = undefined;
      };
    };
    $scope.$watch('name', search, true);
  
  var done = $scope.getDetails = function (id) {
      $scope.clicked = true;
      $scope.sliding = true;
      var api = 'http://api.discogs.com/artists/';
      return $q.all([$http.get(api + id),
                    $http.get(api + id + '/releases?page=1&amp;per_page=100')]);
  };
  
  done.then(function (){
   $scope.releases = data2.releases;
   $scope.artist = data;
   return $http.get('http://ws.audioscrobbler.com/2.0/?method=album.getinfo&amp;api_key=e8aefa857fc74255570c1ee62b01cdba&amp;artist=' + name + '&amp;album='+ title +'&amp;format=json');
  });
  </code></pre>
  
  <p>I'm getting the following console error:</p>
  
  <pre><code>TypeError: Object function (id) {
      $scope.clicked = true;
      $scope.sliding = true;
      var api = 'http://api.discogs.com/artists/';
      return $q.all([$http.get(api + id),
                    $http.get(api + id + '/releases?page=...&lt;omitted&gt;... } has no method 'then'
  at new Ctrl (file:///C:/Users/Zuh/Desktop/AngularJS%20Discogs/js/services.js:27:9)
  </code></pre>
  
  <p>Can anybody point me to where might the error be? I'm defining the .then after getDetails is executed...</p>
  
  <p>Here's a <a href="http://plnkr.co/edit/fK5LDpxHj5NBwOlvNS3z?p=preview" rel="nofollow">working Plunker</a>.</p>