title: AngularJS not reading JSON properly
body: <p>I created an application so that it can read JSON file data using AngularJS HTTP Get method but I am not getting the result in the table as expected.
  Below is the code:</p>
  
  <p><strong>HomeController</strong></p>
  
  <pre><code> using System;
   using System.Collections.Generic;
   using System.Linq;
   using System.Web;
   using System.Web.Mvc;
  
   namespace CategoryWebApplication.Controllers
   {
  public class HomeController : Controller
  {
      // GET: Home
      public ActionResult Index()
      {
          return View();
      }
    }
  }
  </code></pre>
  
  <p><strong>The View : Index.cshtml</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Angular JS Includes&lt;/title&gt;
  &lt;style&gt;
      table, th, td {
          border: 1px solid grey;
          border-collapse: collapse;
          padding: 5px;
      }
  
      table tr:nth-child(odd) {
          background-color: #f2f2f2;
          }
  
      table tr:nth-child(even) {
          background-color: #ffffff;
          }
   &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h2&gt;Sample Category Application&lt;/h2&gt;
  &lt;div ng-app="" ng-controller="categoryController"&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;th&gt;Category ID&lt;/th&gt;
              &lt;th&gt;Category Name&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr ng-repeat="category in categories"&gt;
              &lt;td&gt;{{ category.CategoryID }}&lt;/td&gt;
              &lt;td&gt;{{ category.CategoryName }}&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  &lt;script&gt;
      function categoryController($scope, $http) {
          var url = "http://localhost:4425/Category.txt";
          $http.get(url).success(function (response) {
              $scope.categories = response;
          });
      }
  &lt;/script&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"&gt;    &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And the JSON in the text file category is the following:
  <strong>Category.txt</strong></p>
  
  <pre><code>[
  {
  "CategoryID" : 1,
  "CategoryName" : "Blood"
  },
  {
  "CategoryID" : 2,
  "CategoryName" : "Urine"
  },
  {
  "CategoryID" : 3,
  "CategoryName" : "Saliva"
  },
  {
  "CategoryID" : 4,
  "CategoryName" : "Serum"
  },
  {
  "CategoryID" : 5,
  "CategoryName" : "Hair"
  },
  {
  "CategoryID" : 6,
  "CategoryName" : "Nail"
  },
  {
  "CategoryID" : 7,
  "CategoryName" : "Tissue"
  }
  
  ]
  </code></pre>
  
  <p>Below is the result I am getting in the browser</p>
  
  <p><a href="https://i.stack.imgur.com/kZ1Cf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kZ1Cf.png" alt="enter image description here"></a></p>