title: Angular / Controller loading a json file fails with an exception I can not understand
body: <p>sorry, maybe a stupid problem, but I am still a newbie with angular. </p>
  
  <p>The code: </p>
  
  <p>-- EDIT #2 -- ----- ----- ----- ----- ----- ----- ----- </p>
  
  <pre><code>MyApp.controller('DataController', ['$http', function ($http) {
  
          var self = this;
  
          var objects = [];
          var loaded = false;
  
          var getObjects = function () {
              if(!loaded){
                  setRawObjects();
              }
              return objects;
          };
  
          var setRawObjects = function(){
              $http.get('data/objects.json').success(function (response) {
                  loaded=true;
              });
          }
  
          var openDetail = function () {
              console.log('test');
          }
  
          self.getObjects = getObjects;
          self.openDetail = openDetail;
      }]);
  </code></pre>
  
  <p>-- END OF EDIT #2 -- ----- ----- ----- ----- ----- ----- </p>
  
  <p>The Error: </p>
  
  <pre><code>Error: [$rootScope:infdig] http://errors.angularjs.org/1.5.5/$rootScope/infdig?p0=10&amp;p1=%5B%5D
      at angular.js:38
      at n.$digest (angular.js:17111)
      at n.$apply (angular.js:17337)
      at angular.js:1749
      at Object.invoke (angular.js:4665)
      at c (angular.js:1747)
      at yc (angular.js:1767)
      at ee (angular.js:1652)
      at angular.js:30863
      at HTMLDocument.b (angular.js:3166)
  
  angular.js:38Uncaught Error: [$rootScope:infdig] http://errors.angularjs.org/1.5.5/$rootScope/infdig?p0=10&amp;p1=%5B%5D
      at angular.js:38
      at n.$digest (angular.js:17111)
      at n.$apply (angular.js:17337)
      at angular.js:1749
      at Object.invoke (angular.js:4665)
      at c (angular.js:1747)
      at yc (angular.js:1767)
      at ee (angular.js:1652)
      at angular.js:30863
      at HTMLDocument.b (angular.js:3166)
  </code></pre>
  
  <p>Exception is thrown twice. I connot imagine what it means, whats wrong?
  This line seems to curse the problem: </p>
  
  <pre><code>return $http.get('data/objects.json').success(function(response) {
  </code></pre>
  
  <p>The controller is beeing initiated in this way: </p>
  
  <pre><code>EspanioApp.controller('DataController', ['$http', function ($http) {...
  </code></pre>
  
  <p>Do you have any hint for me how I can fix this?</p>
  
  <p>cu n00n</p>