      <p>Controller:</p>
                  <pre class="prettyprint">
// Define your custom configuration
$scope.buttonConfig = {
  success_class:  'btn-success',
  error_class:    'btn-danger',
  progress_class: 'btn-warning',
  idle_class:     'btn-default',
  delay:          2000
};

// Create a new promise that will succeed in 3 seconds
$scope.setButtonPromise = function(){
  // Set $scope.promise with a new promise
  $scope.buttonPromise = $q.defer();

  // React to promise in controller
  $scope.button