title: Button change when user submit form
body: <p>I have this 2 button which is save and saving... </p>
  
  <pre><code>&lt;div ng-switch on="isLoading"&gt;
   &lt;div ng-switch-when="true"&gt;
    &lt;button type="button" class="btn btn-primary btn-block disabled"&gt;Saving ...&lt;/button&gt;
   &lt;/div&gt;
  
   &lt;div ng-switch-when="false"&gt;
    &lt;button type="submit" class="btn btn-primary btn-block" ng-disabled="!allowSubmit(addUser)" ng-click="add();"&gt;Save&lt;/button&gt;
   &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>What i want is that before user click to submit the form, button remain as 'save' and after user click that save button it will change to 'saving...' button for 2 seconds. I tried and planning to use $timeout but it turns out the whole form got delayed for 2 seconds.</p>
  
  <pre><code>    $dialogScope.add = function() {
                  if ($dialogScope.user.password != $dialogScope.user.confirmpassword &amp;&amp; $dialogScope.user.username) {
                      $dialogScope.hasError = true
                      $dialogScope.errorMessage = "Password does not match";
                      return $dialogScope.errorMessage;
                  }
                  var copy = angular.copy($dialogScope.user);
              }
              $timeout(function() {
                  $dialogScope.hasError = false;
                  $scope.users.push(copy);
                  $dialogScope.closeThisDialog();
              }, 2000);
  </code></pre>
  
  <p>how i suppose to do that? </p>