title: AngularJS Scope Variables not Updating
body: <p>Strange error here. I have this form:</p>
  
  <pre><code>&lt;form name="newaccount" id="newaccount" ng-submit="doSubmit()"&gt;
  &lt;label&gt;username&lt;/label&gt;
  &lt;input name="username" type="text" required ng-model="username"&gt;
  &lt;span ui-toggle="username.length &gt; 15"&gt;Too long!&lt;/span&gt;
  &lt;label&gt;name&lt;/label&gt;
  &lt;input name="name" type="text" required ng-model="name"&gt;
  &lt;label&gt;e-mail&lt;/label&gt;
  &lt;input name="email" type="email" required ng-model="email" ui-validate&gt;
  &lt;label&gt;password&lt;/label&gt;
  &lt;input name="password" type="password" required ng-model="password" ui-validate&gt;
  &lt;div style="text-align: center;"&gt;&lt;br&gt;
  &lt;input type="submit"&gt;&lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And this controller:</p>
  
  <pre><code>$scope.username = "f";
  $scope.password = "f";
  $scope.email = "f";
  $scope.name = "f";
  $scope.doSubmit = function(){
      //Transition to progress view
      $scope.showLoginForm = false;
      $scope.showCreateForm = false;
      $scope.showLoading = true;
      $scope.resultSuccess = false;
      $scope.showResult = false;
      $scope.loadingMessage = "Creating account...";
      $scope.resultReason = "Success!";
  
      //Send POST
      $http({
          method: 'POST',
          url: "php/createaccount.php",
          data: {
              "username": $scope.username,
              "password": $scope.password,
              "name": $scope.name,
              "email": $scope.email
          }}
      ).success(function (data, status, headers, config) {
              $scope.showLoading = false;
              $scope.showResult = true;
              $scope.resultSuccess = data === "success";
              if($scope.resultSuccess){
                  $scope.resultReason = "Account created successfully!";
              }else{
                  $scope.resultReason = data;
              }
  
          }).error(function (data, status, headers, config) {
              $scope.showLoading = false;
              $scope.showResult = true;
              $scope.resultSuccess = false;
              $scope.resultReason = data;
          });
  };
  </code></pre>
  
  <p>As expected, "f" appears in each of the fields. However, if you change these fields and then submit the form, the server responds (with a print_r() on the post data) showing that the JSON received by the backend ALWAYS will contain "f" as the value for each of the fields, not the changed values.</p>
  
  <p>Example:
  with username "test" etc.</p>
  
  <pre><code>{"username":"f","password":"f","name":"f","email":"f"}
  </code></pre>
  
  <p>Therefore, the values in $scope aren't getting updated for some reason when I type in the forms. What gives?</p>