title: Cannot set Angular scope variable from within ajax call
body: <pre><code>var req = {
              "RequestId": $scope.$parent.req_id,
              "RequestDate": new Date(),
              "RequestDetails": $scope.$parent.details
          };
  
  $scope.req_result = "test";
  
  $.ajax({
              type: "POST",
              url: 'http://localhost:49358/api/myClasses/PostRequest',
              data: JSON.stringify(req),
              contentType: "application/json;charset=utf-8",
              processData: true,
              success: function (data, status, xhr) {
                  console.log("The result is : " + status);
                  $scope.req_result = "Post succeeded";
              },
              error: function (xhr) {
                  $scope.req_result = "ERROR: " + xhr.responseText
              }
          });
  </code></pre>
  
  <p>The scope variable $scope.req_result does not get set so when I attempt to display it on the html view page:</p>
  
  <pre><code>&lt;span&gt;{{req_result}}&lt;/span&gt;
  </code></pre>
  
  <p>it displays the default value. Somehow what ajax is doing is not known to angular</p>