title: Not getting json rest response in my AngularJS application
body: <p>This has been frustrating me a bit. I have a restful services giving JSON data running on the link:
  <a href="http://localhost:51133/API/SalesSystem/" rel="nofollow noreferrer">http://localhost:51133/API/SalesSystem/</a></p>
  
  <p>So its running locally on my computer. I can get the data from this service with no problem using my WPF based interface.</p>
  
  <p>Another service I am testing with is this one:
  <a href="http://rest-service.guides.spring.io/greeting" rel="nofollow noreferrer">http://rest-service.guides.spring.io/greeting</a></p>
  
  <p>But from my own service something seems to go wrong somehow and I cannot figure out what goes wrong. I have even tried just taking the full response and printing it. With the second service, I get a long list of data regarding the response, but with my own I still get nothing. As if the function was not used at all.</p>
  
  <p>This is my Angular code:</p>
  
  <pre><code>angular.module('demo', [])
      .controller('Hello', function ($scope, $http) {
          $http.get('http://localhost:51133/api/salessystem/').
              //http://rest-service.guides.spring.io/greeting 
              //http://localhost:51133/API/SalesSystem/
              then(function (response) {
                  $scope.hello = 'hello';
                  $scope.district = response;
              });
      });
  </code></pre>
  
  <p>and this is my html code:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html ng-app="demo"&gt;
  &lt;head&gt;
      &lt;title&gt;Hello AngularJS&lt;/title&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular.min.js"&gt;&lt;/script&gt;
      &lt;script src="Scripts/hello.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;div ng-controller="Hello"&gt;
          &lt;li&gt;Id: &lt;button&gt;{{hello}}&lt;/button&gt;&lt;/li&gt;
          &lt;li&gt;Area: {{district}}&lt;/li&gt;
          &lt;ul ng-repeat="obj in hello"&gt;
              &lt;li&gt;Area: {{obj.area}}&lt;/li&gt;
          &lt;/ul&gt;
          &lt;p&gt;The ID is {{hello.Id}}&lt;/p&gt;
          &lt;p&gt;The content is {{hello.Area}}&lt;/p&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Can anyone see the problem? The spring rest service shows all kinds of data about the response and it also shows the button with "hello" inside it. But when I use my own service link it seems there is no $scope returned at all.</p>
  
  <p>Oh, and this is the json returned when I just visit the link directly in the browser: (its an array of 3 districts)</p>
  
  <pre><code>[{"Id":1,"Area":"North Denmark","PrimarySalespersonID":1,"PrimarySalesperson":{"Id":1,"Name":"Tom B. Erichsen"},"SecondarySalespersons":null,"Stores":null},{"Id":2,"Area":"Southern Denmark","PrimarySalespersonID":2,"PrimarySalesperson":{"Id":2,"Name":"Eric B. Thomsen"},"SecondarySalespersons":null,"Stores":null},{"Id":3,"Area":"Eastern Denmark","PrimarySalespersonID":3,"PrimarySalesperson":{"Id":3,"Name":"Ben Anderson"},"SecondarySalespersons":null,"Stores":null}]
  </code></pre>