Git Product home page Git Product logo

mmsspinner's Introduction

mmsSpinner

Demo

Inspiration: AngularSpinner

Dependencies: noopee!

Installation

1. Download the directive via bower:

bower install mms-spinner --save-dev

2. Include the .js and .css files into your index.html:

<script src="bower_components/mms-spinner/src/mms-spinner.js"></script>
<link rel="stylesheet" href="bower_components/mms-spinner/src/mms-spinner.css">

3. Insert the module name into your angular app:

angular.module('yourApp', [
  'mms-spinner',
]);

4. Declare the directive in markup:

<button type="button" class="btn btn-primary mms-spinner" spinner-key="btnSpinner" height="10px" width="10px" color="black" ng-click="click()">Click me</button>

5. Use mmsSpinnerService to start/stop the spinner:

.controller('mainCtrl', ['MmsSpinnerService', '$scope', function(MmsSpinnerService, $scope) {
  
  var on = false;

  $scope.click = function() {
    on = !on;

    if(on) {
      MmsSpinnerService.start('btnSpinner');
    } else {
      MmsSpinnerService.stop('btnSpinner');
    }

  };

}]);

Further Information

  • height and width parameters should always be specified, as they will other wise return default values
  • The spinner-key attribute must be specified as otherwise the spinner will not be usable
  • The color attribute you're setting is actually the border color. It will default to black
  • A working demo can be found in the demo folder

Contribution

Feel free to fix bugs or enhance the module. I'd love to see that :)

mmsspinner's People

Contributors

timdaub avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.