title: angularjs : Possibly unhandled rejection $http.get() - Status: -1 CORS
body: <p>I am getting the below error when using a http get method.</p>
  
  <pre><code>:63502/Scripts/angular.js:14525 Possibly unhandled rejection: {"data":null,"status":-1,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","params":{"id":"23"},"url":"api/Project/GetProject","headers":{"Accept":"application/json, text/plain, */*"}},"statusText":""}
  </code></pre>
  
  <p>HTML code,</p>
  
  <pre><code>&lt;div class="row pb-20px text-center"&gt;
                  &lt;label class="col-sm-2 lb-date" for="projid"&gt;Project ID&lt;/label&gt;
                  &lt;input type="text" id="projid" class="col-sm-2" ng-model="project.id" /&gt;
                  &lt;div style="padding-left:10px;"&gt;
                      &lt;button type="submit" class="btn btn-primary col-sm-2" ng-click="ProjSearch()"&gt;Submit&lt;/button&gt;
                  &lt;/div&gt;
                  &lt;/div&gt;
  </code></pre>
  
  <p>Angular code,</p>
  
  <pre><code>var myView = angular.module('myView', []);
  myView.controller('ViewCtrl', ['$scope', '$http', '$filter', function ($scope, $http, $filter) {
  $scope.ProjSearch = function () {
      debugger;
      t = {
          'id': $scope.project.id
      };
      var r = $http.get('api/Project/GetProject', { params: t })
              .then(function (response) {
                  result = response.data;
  
                  var c;
  
                  $scope.project.title = result.ProjectTitle;
  </code></pre>
  
  <p>Please suggest on how to clear the error.</p>