• Stars
    star
    697
  • Rank 62,646 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 11 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Angular directive to show an animated spinner (using spin.js)

angular-spinner

Angular directive to show an animated spinner (using spin.js)

Copyright (C) 2013, 2014, 2015, 2016, 2017 Uri Shaked, Islam Attrash and contributors

Build Status Coverage Status

Usage

Get angular-spinner

  • via npm: by running $ npm install angular-spinner from your console
  • via bower: by running $ bower install angular-spinner from your console

Include angular-spinner.js in your application.

import 'angular-spinner';

OR:

require('angular-spinner');

OR by picking one of the following file (depends on the package manager):

<script src="bower_components/angular-spinner/dist/angular-spinner.min.js"></script>
<script src="node_modules/angular-spinner/dist/angular-spinner.min.js"></script>

Add the module angularSpinner as a dependency to your app module:

var myapp = angular.module('myapp', ['angularSpinner']);

You can now start using the us-spinner directive to display an animated spinner. For example :

<span us-spinner></span>

You can also pass spinner options, for example:

<span us-spinner="{radius:30, width:8, length: 16}"></span>

Possible configuration options are described in the spin.js homepage.

You can direct the spinner to start and stop based on a scope expression, for example:

<span us-spinner="{radius:30, width:8, length: 16}" spinner-on="showSpinner"></span>

Configuring default spinner options

You can use usSpinnerConfigProvider to configure default options for all spinners globally. Any options passed from a directive still override these.

myapp.config(['usSpinnerConfigProvider', function (usSpinnerConfigProvider) {
    usSpinnerConfigProvider.setDefaults({color: 'blue'});
}]);

Themes

Themes provide named default options for spinners. Any options passed from a directive still override these.

myapp.config(['usSpinnerConfigProvider', function (usSpinnerConfigProvider) {
    usSpinnerConfigProvider.setTheme('bigBlue', {color: 'blue', radius: 20});
    usSpinnerConfigProvider.setTheme('smallRed', {color: 'red', radius: 6});
}]);
<span us-spinner spinner-theme="smallRed"></span>

Using the usSpinnerService to control spinners

<button ng-click="startSpin()">Start spinner</button>
<button ng-click="stopSpin()">Stop spinner</button>

<span us-spinner spinner-key="spinner-1"></span>

The usSpinnerService service let you control spin start and stop by key. Whenever the key is not specified all the spinner will be affected (Start/Stop all spinners):

app.controller('MyController', ['$scope', 'usSpinnerService', function($scope, usSpinnerService){
    $scope.startSpin = function(){
        usSpinnerService.spin('spinner-1');
    }
    $scope.stopSpin = function(){
        usSpinnerService.stop('spinner-1');
    }
}]);

Note that when you specify a key, the spinner is rendered inactive. You can still render the spinner as active with the spinner-start-active parameter :

<span us-spinner spinner-key="spinner-1" spinner-start-active="true"></span>

spinner-start-active is ignored if spinner-on is specified.

The spinner-key will be used as an identifier (not unique) allowing you to have several spinners controlled by the same key :

<span us-spinner spinner-key="spinner-1"></span>
<span us-spinner spinner-key="spinner-2"></span>

... random html code ...

<!-- This spinner will be triggered along with the first "spinner-1" -->
<span us-spinner spinner-key="spinner-1"></span>

Example

See online example on Plunker.

License

Released under the terms of MIT License.

Contributing

  1. Fork repo.
  2. npm i
  3. Make your changes, add your tests.
  4. npm run test
  5. npm run build once all tests are passing. Commit, push, PR.

More Repositories

1

angular-moment

Moment.JS directives for Angular.JS (timeago and more)
JavaScript
2,609
star
2

ngx-moment

moment.js pipes for Angular
TypeScript
1,174
star
3

firebase-server

Firebase Realtime Database Server Implementation
TypeScript
674
star
4

muse-js

Muse 2016 EEG Headset JavaScript Library (using Web Bluetooth)
TypeScript
267
star
5

angular-load

Dynamically load scripts and css stylesheets in your Angular.JS app
JavaScript
242
star
6

angular-iot

Internet of Things directives for Angular 2 (Led, Button, etc.)
TypeScript
95
star
7

gulp-add-src

Add more 'src' files at any point in the pipeline (gulp plugin)
JavaScript
86
star
8

web-bluetooth-polyfill

Windows 10 Web Bluetooth Polyfill
JavaScript
76
star
9

web-ar-experiment

Experimenting with WebAR
HTML
68
star
10

arduino-slack-bot

A Real Time Slack Bot for Arduino (ESP8266)
Arduino
64
star
11

win-ble-cpp

Proof of Concept - BLE on Windows (for Web Bluetooth)
C++
63
star
12

pdfium-wasm

Building PDFium for Web Assembly
Dockerfile
61
star
13

ng2-simon

Simon Game for angular2-iot
Eagle
58
star
14

bigtsquery

Search Engine for TypeScript Code using AST Queries
TypeScript
50
star
15

web-lightbulb

Smart Light Bulb Web App (using Web Bluetooth)
JavaScript
49
star
16

muse-blink

Blink detection with Muse EEG Headset + Angular demo
TypeScript
43
star
17

angular-placeholder-shim

Angular directive to make the input/textarea placeholder attribute work on all browsers.
JavaScript
41
star
18

tsquery-playground

Playground for TSQuery
TypeScript
37
star
19

muse-lsl

Muse 2016 EEG Headset LSL (NodeJS)
JavaScript
32
star
20

purple-eye

A web-bluetooth controlled one-eyed robot
C++
26
star
21

ng-beacon

ng-beacon - Smart JavaScript Beacon shaped after the Angular logo
Eagle
24
star
22

angular2-material-build

Material Design for Angular2
JavaScript
22
star
23

angular-static-site

Static Website with Angular - Build time rendering
TypeScript
20
star
24

beat-machine

Salsa Beat Machine 5 (Next.js + Web Audio)
TypeScript
20
star
25

node-lsl

LibLSL bindings for Node.js
JavaScript
20
star
26

cinto

Python
20
star
27

awesome-web-bluetooth

Awesome list of Web Bluetooth Libraries, Demos and Resources
17
star
28

ng-lift

Automated tooling for upgrading Angular.js app to Angular
TypeScript
17
star
29

vscode-tsquery

TSQuery extension for Visual Studio Code
TypeScript
17
star
30

AndroidThingsCounter

Android Things app that uses a 7-Segment to display counter
Java
16
star
31

web-bluetooth-mock

Mock Implementation of Web Bluetooth (for tests)
TypeScript
15
star
32

aramcon-badge

Just a badge
Python
15
star
33

pdfium-wasm-example

Example of using PDFium Web Assembly build in Node.js
JavaScript
15
star
34

real-trex-runner

IRL version of Chrome Offline T-Rex game
JavaScript
13
star
35

heart-ariella

Heart-shaped flashlight PCB for Ariella
Eagle
12
star
36

java-openal

OpenAL JNA Wrappers for Java
Java
12
star
37

vr-hero-aframe

VR Hero: Invaders game with Angular + A-Frame
TypeScript
11
star
38

d3-angularjs-demo

Demo code for my talk: "Visualizing Data streams using Angular & D3.js"
JavaScript
11
star
39

TiMedia

AVFoundation wrappers for Titanium
Objective-C
11
star
40

angular-aframe-pipe

A-Frame pipe for interop with Angular
TypeScript
11
star
41

solidity-contracts

A collection of solidity contracts found on Github
JavaScript
11
star
42

webble-mip

MiP Robot Web Bluetooth App
HTML
10
star
43

circuitpython-mp3-ble

Streaming MP3 over BLE using CircuitPython and VS1053
Python
10
star
44

panda

Panda Logo PCB
Batchfile
9
star
45

angular-promises-toolkit

Extends the Angular.JS promise API with useful methods
JavaScript
9
star
46

aframe-fireball-component

Fireball component for A-Frame
JavaScript
8
star
47

love

Because branches also need some love!
8
star
48

gwt-titanium

A GWT module for Appcelerator's Titanium Platform
Java
8
star
49

t-rex-vr

VR Experiment T-Rex Game
JavaScript
8
star
50

ZlSound

Zero Latency Sound module for Titanium
Objective-C
8
star
51

nn-function-generator

Experimenting with automatic generation of TS function bodies using ANN models
TypeScript
8
star
52

ml-comments-gen

Generating source code comments with Machine Learning
TypeScript
8
star
53

tiny-simon

Simon Says game for ATTiny85
C++
8
star
54

aframe-camera-events

A-Frame helper to emit events when camera position / orientation changes
JavaScript
7
star
55

ng-beacon-app

Angular app to control ng-beacons
TypeScript
7
star
56

noble-winrt

WinRT bindings for Noble (using BLEServer.exe)
JavaScript
7
star
57

ctf-shittyaddon

Capture The Flag Shitty Addon
C++
7
star
58

typewiz-webpack-demo

Demo of using TypeWiz with WebPack
JavaScript
6
star
59

m3d-tools

Command line tools for interacting with the M3D Printer
C#
6
star
60

battery-bulb

Battery Powered Magic Blue bulb
5
star
61

angular-es6-promises

ECMAScript 6 promises for Angular.JS
JavaScript
5
star
62

trumpet-nuggets

Web MIDI Snippets created by attendees during Chrome Dev Summit 2018
TypeScript
5
star
63

web-bluetooth-mamush

Live coding Web Bluetooth, a smart light bulb, Muse EEG headset and Chrome T-Rex game with React
JavaScript
5
star
64

spinduino-js

POV Fidget spinner running JavaScript
JavaScript
5
star
65

web-bluetooth-secure-dfu

nRF5x Secure DFU over Web Bluetooth PoC
JavaScript
5
star
66

magicblue

Control Magic Blue Bulbs using Web Bluetooth
TypeScript
4
star
67

android-hello-arm

Hello world in Android ARM assembly
Batchfile
4
star
68

m3d-pro-gcodes

GCodes and Troubleshooting for the M3D Pro
4
star
69

hot-or-not

Hot or Not game for ng-beacons
TypeScript
4
star
70

elm-smart-bulb

Initial PoC of controlling a Smart Bluetooth Bulb from Elm code using Web Bluetooth
Elm
4
star
71

valentines-vr

Small VR heart-collecting game for Valentines, live-coding during a IoT Makers meetup using A-Frame
HTML
4
star
72

vr-audio-visualizer

Audio Visualization Experiment with Angular + A-Frame
TypeScript
4
star
73

bluetooth-buzzer-button

Bluetooth Smart Buzzer Button, programmable with JavaScript
JavaScript
4
star
74

ng-beacon-firmware

ng-beacon firmware builds
4
star
75

particle-mesh-broadcast

Sample code for broadcasting a message over the local mesh network using UDP
C++
3
star
76

web-midi-playground

Web MIDI Playground for Chrome Dev Summit demo
TypeScript
3
star
77

bitcoin-action-express

"Bitcoin Info" Assistant Action with TypeScript + Express
TypeScript
3
star
78

web-bluetooth-typings

Typings for Web Ble
TypeScript
3
star
79

ng-beacon-firmware-old

JavaScript Firmware for ng-beacon (based on Espruino)
Shell
3
star
80

espruino-mirror

Cast Espruino Pixl.js Display over BLE connection
TypeScript
3
star
81

doggie

A simple android watchdog application
Java
3
star
82

ng2-simon-highscore

App to display ng2-simon highscore on a TV
TypeScript
3
star
83

ac-generators

AngularConnect Generators + Protractor demo (TopCat)
JavaScript
3
star
84

t-rex-blinks

Chrome T-Rex Game controlled by eye blinks
JavaScript
3
star
85

firebase-localstorage-fix

Firebase 3.1.0 with support for disabled LocalStorage (e.g. private browsing in Safari)
JavaScript
3
star
86

iphonejava-hello-world

Hello world iPhone application written in Java!
Java
3
star
87

protractor-firebase

Utilities for interacting with Firebase within protractor tests
JavaScript
3
star
88

pi-thingy52-weather

Weather Station using Raspberry Pi, Thingy52 and HSDPA dongle
JavaScript
3
star
89

extract-java-classes

Extract all Java class definitions from the Github dataset
JavaScript
2
star
90

coronavirus-3d

Corona Virus 3D
HTML
2
star
91

ng2-topcat

Angular 2 + Firebase Cat Rating System
TypeScript
2
star
92

muse-systemjs

Muse EEG Headset + SystemJS Minimal Setup
HTML
2
star
93

vr-talk-assets

Assets for WebVR talk
TypeScript
2
star
94

solidity-downloader

Downloads a bunch of Solidity Contracts from GitHub Repos
JavaScript
2
star
95

serial-7segment-20mm

PCB + Firmware for 20mm Serial 7-Segment Display
Eagle
2
star
96

ng-pitfalls-demos

Code samples from my presenetation "Avoiding Common Pitfalls in AngularJS"
JavaScript
2
star
97

lightshow-poc

JavaScript
2
star
98

aramcon-broadcast

Broadcast MP3 Data over ESB (Enhanced ShockBurst) using nRF52840 + USB CDC
C
2
star
99

ble-pressure-sensor

Bluetooth Low Energy Pressure Sensor with Espruino
TypeScript
2
star
100

sa2015-topcat

Topcat
JavaScript
2
star