title: Expected Array but received ...(JSON)... AngularJS Error
body: <p>I'm learning Angular1 from Adam Freeman's ,,Pro AngularJS" book. I've got a problem with building a DeployD app he's describing in chapters 6-8 - it seems like my code doesn't want to read JSON</p>
  
  <p>That's my HTML: </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html ng-app="sportsStore" lang="pl"&gt;
  &lt;head&gt;
      &lt;title&gt;SportsStore&lt;/title&gt;
      &lt;script src="components/angular.js"&gt;&lt;/script&gt;
      &lt;script src="components/angular-resource.js"&gt;&lt;/script&gt;
      &lt;link href="components/bootstrap.css" rel="stylesheet" /&gt;
      &lt;link href="components/bootstrap-theme.css" rel="stylesheet" /&gt;
      &lt;script&gt;
          angular.module("sportsStore", ["customFilters"]);
      &lt;/script&gt;
      &lt;script src="controllers/sportsStore.js"&gt;&lt;/script&gt;
      &lt;script src="filters/customFilters.js"&gt;&lt;/script&gt;
      &lt;script src="controllers/productListControllers.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body ng-controller="sportsStoreCtrl"&gt;
  &lt;div class="navbar navbar-inverse"&gt;
      &lt;a class="navbar-brand" href="#"&gt;SKLEP SPORTOWY&lt;/a&gt;
  &lt;/div&gt;
  &lt;div class="panel panel-default row" ng-controller="productListCtrl"&gt;
      &lt;div class="alert alert-danger" ng-show="data.error"&gt;
          Błąd ({{data.error.status}}). Dane produktu nie zostały wczytane.
          &lt;a href="/index.html" class="alert-link"&gt;Kliknij tutaj, aby spróbować ponownie&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="panel panel-default row" ng-controller="productListCtrl"
           ng-hide="data.error"&gt;
      &lt;div class="col-xs-3"&gt;
          &lt;a ng-click="selectCategory()"
             class="btn btn-block btn-default btn-lg"&gt;Strona główna&lt;/a&gt;
          &lt;a ng-repeat="item in data.products | orderBy:'category' |
  unique:'category'" ng-click="selectCategory(item)" class=" btn btn-block
  btn-default btn-lg" ng-class="getCategoryClass(item)"&gt;
              {{item}}
          &lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="col-xs-8"&gt;
          &lt;div class="well"
               ng-repeat="item in data.products | filter:categoryFilterFn |
  range:selectedPage:pageSize"&gt;
              &lt;h3&gt;
                  &lt;strong&gt;{{item.name}}&lt;/strong&gt;
                  &lt;span class="pull-right label label-primary"&gt;
  {{item.price | currency}}
  &lt;/span&gt;
              &lt;/h3&gt;
              &lt;span class="lead"&gt;{{item.description}}&lt;/span&gt;
          &lt;/div&gt;
          &lt;div class="pull-right btn-group"&gt;
              &lt;a ng-repeat="page in data.products | filter:categoryFilterFn |
                      pageCount:pageSize" ng-click="selectPage($index + 1)" class="btn
  btn-default" ng-class="getPageClass($index + 1)"&gt;
                  {{$index + 1}}
              &lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and the sportStore.js controller</p>
  
  <pre><code>angular.module("sportsStore")
      .constant("dataUrl", "http://localhost:5500/products")
      .controller("sportsStoreCtrl", function ($scope, $http, dataUrl) {
          $scope.data = {};
          $http.get(dataUrl)
              .then(function (data) {
                  $scope.data.products = data;
              },
              function (error) {
                  $scope.data.error = error;
              });
      });
  </code></pre>
  
  <p>I'm using DeployD to build an API, and the problem is that when I try to run my app, the error shows up in console: </p>
  
  <blockquote>
    <p>Error: [filter:notarray] Expected array but received:
    {"data":[{"name":"Kajak","description":"Łódka przeznaczona dla jednej
    osoby","category":"Sporty
    Wodne","price":275,"id":"d9b9e4fcb9df3853"},{"name":"Kamizelka
    ratunkowa","description":"Chroni i dodaje uroku","category":"Sporty
    wodne","price":49.75,"id":"3c1cceedb44ddb84"},{"name":"Piłka","description":"Zatwierdzona
    przez FIFA rozmiar i waga","category":"Piłka
    Nożna","price":19.5,"id":"447a2079a8488932"},{"name":"Flagi
    narożne","description":"Nadadzą Twojemu boisku profesjonalny
    wygląd","category":"Piłka
    Nożna","price":34.95,"id":"2b2dd597f18bb8a7"},{"name":"Stadion","description":"Składany
    stadion na 35000 osób","category":"Piłka
    Nożna","price":79500,"id":"2cfe0f6767240bf9"},{"name":"Czapka","description":"Zwiększa
    efektywność mózgu o
    75%","category":"Szachy","price":16,"id":"dfc137db43574b4a"},{"name":"Niestabilne
    krzesło","description":"Zmniejsza szansę
    przeciwnika","category":"Szachy","price":29,"id":"e2b644c5091d28ca"},{"name":"Ludzka
    szachownica","description":"Przyjemna gra dla całej
    rodziny","category":"Szachy","price":75,"id":"f945806bb011895d"},{"name":"Błyszczący
    król","description":"Pokryty złotem i wysadzany diamentami
    król","category":"Szachy","price":1200,"id":"fab242704bb38b64"}],"status":200,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"<a href="http://localhost:5500/products" rel="nofollow noreferrer">http://localhost:5500/products</a>","headers":{"Accept":"application/json,
    text/plain, <em>/</em>"}},"statusText":"OK"}
    <a href="http://errors.angularjs.org/1.6.0-rc.1/filter/notarray?p0=%7B%22data%22%3A%" rel="nofollow noreferrer">http://errors.angularjs.org/1.6.0-rc.1/filter/notarray?p0=%7B%22data%22%3A%</a>…son%2C%20text%2Fplain%2C%20*%2F*%22%7D%7D%2C%22statusText%22%3A%22OK%22%7D
        at angular.js:68
        at angular.js:20392
        at fn (eval at compile (angular.js:15095), :4:388)
        at regularInterceptedExpression (angular.js:16203)
        at Scope.$digest (angular.js:17732)
        at Scope.$apply (angular.js:18006)
        at done (angular.js:12150)
        at completeRequest (angular.js:12376)
        at XMLHttpRequest.requestLoaded (angular.js:12304)</p>
  </blockquote>
  
  <p>I tried to skim through similar errors on SO but none of the solutions seemed to work for me. Did someone have a similar problem? </p>