Implementation of an angularJS directive for a button with a busy indicator
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
indiClick.js

README.md

indicated-angular-button

Implementation of a directive for a button with a busy indicator using spin.js

Depends On

1. spin.js (doesn't depend on jQuery) 2. angular.js

Usage

<button type="submit" class="btn btn-success btn-lg" data-indi-click="vm.getComments()">Get Comments</button>

Example

HTML

....
<div class="row" data-ng-controller="qtestController as vm" ng-cloak>
    <h1>Q Experiments</h1>
    <form class="form-inline" role="form">

        <button type="submit" class="btn btn-success btn-lg" data-indi-click="vm.getComments()">Get Comments</button>

    </form>
   
</div>
<script src="/Scripts/spin.js"></script>
<script src="/Scripts/angular.min.js"></script>
....

Controller

(function () {
  'use strict';
  var controllerId = 'qtestController';
  angular.module('app').controller(controllerId,
	['$scope', 'qtestDataService', qtestController]);

  function qtestController($scope, qtestDataService) {
      var vm = this;
      vm.comments = [];
      vm.getComments = getComments;

      //#region Internal Methods        
      function getComments() {
          vm.comments = qtestDataService.getDataQ(); // returns a promise
          return vm.comments;
      }

      //#endregion
  }
})();

License

MIT license - http://www.opensource.org/licenses/mit-license.php