title: Azure mobile services NodeJS Backend AngularJS Function not returning results
body: <p>Here's the situation.</p>
  
  <p>All appropriate javascripts are loaded and called.  I can debug and step through and see that data is being retrieved from the mobile service and no errors are in the javascript console.</p>
  
  <p>Issue is that the "done()" of the getTable call is called twice and the data is not returned back to the module function which calls the method so no list is created in the page.  </p>
  
  <p>I'm sure I'm missing something simple but I can't seem to see it.</p>
  
  <p>Angular Controler</p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>var appModule = angular.module('myApp');
  
  appModule.controller('clientsController', [
      "$scope", "$rootScope", "$http", "$window", "ClientsDataService", function ($scope, $rootScope, $http, $window, ClientsDataService) {
          $rootScope.title = "Client List";
          $scope.clients = ClientsDataService.getAllClients();
      }
  ]);
  </code></pre>
  
  
  
  <p>Angular Module Function</p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>var clientModule = angular.module('myApp');
  
  clientModule.factory("ClientsDataService", [
      '$http', '$q', function ($http, $q) {
          var _getAllClients = function () {
              return getAllClients();
          }
  
          return { "getAllClients": _getAllClients };
      }
  ]);
  </code></pre>
  
  
  
  <p>Azure Service Call
  </p>
  
  
  
  <pre><code>function getAllClients() {
      azureClient.getTable("Client")
          .read()
          .done(
              function (results) {
                  var clientArray = new Array();
                  for (var i = 0; i &lt; results.length; i++) {
                      clientArray.push({
                          "Name": results[i].ClientName,
                          "AcountExecutive": results[i].AccountExecutiveName,
                          "ClientPartner": results[i].ClientPartnerName,
                          "Revenue": results[i].RevenueInMillions,
                          "Industry": results[i].Industry,
                          "Notes": results[i].Notes,
                          "CompanyUrl": results[i].CompanyUrl,
                          "InfoUrl": results[i].InfoUrl,
                          "LogoUrl": results[i].LogoUrl,
                          "Lat": results[i].Latitude,
                          "Lng": results[i].Longitude
                      });
                  }
                  return JSON.stringify(clientArray);
              },
              function (err) {
                  console.log(err);
              });
  }
  </code></pre>