title: 401 Unauthorized ajax call from angular node application calling Web Api 2 application
body: <p>I have been able to make calls just fine to <strong>Web Api</strong> from an <strong>Angular</strong> / Node application when I use the <strong>$sce</strong> for an <strong>IFrame</strong>,  but now I want to call Web Api from jquery ajax within the application.</p>
  
  <p>When I try to call it I get</p>
  
  <p><strong>401 Unauthorized</strong></p>
  
  <pre><code>function getComments() {
      $.ajax({
  
          url: 'http://localhost:17308/Home/GetNewsComments?id=' + group, 
          type: 'Get',
          data: { id: tipId },
          success: function (data) {
              $("#commentDetail").empty().append(data);
          },
          error: function () {
              //alert("something seems wrong");
              console.log("something is wrong");
          }
      });
  };
  </code></pre>
  
  <p><strong>FYI / BTW</strong> </p>
  
  <p><strong>I HAVE been able to make calls for IFrame with</strong></p>
  
  <pre><code>$scope.setTipId = function (id) {
     $scope.detailFrame = $sce.trustAsResourceUrl("http://localhost:17308/Home/GetNewsComments?id=" + id);
  </code></pre>
  
  <p>Can I do something similar for my jquery ajax calls from my controller?</p>
  
  <p><strong>Update</strong></p>
  
  <p>I even tried the "angular way"</p>
  
  <pre><code>$http.get('http://localhost:17308/CommentCount/').success(function (data) {
          console.log('made it');
      })
      .error(function () {
          console.log('error');
      });
  </code></pre>
  
  <p>I still get the 401 error...</p>