1+ A library with more than 50 different loading spinners for Angular 4/5/6/7/8/9. (https://napster2210.github.io/ngx-spinner/ )
2+
13<p align =" center " >
24 <img height =" 200px " width =" 200px " style =" text-align : center ;" src =" https://cdn.rawgit.com/Napster2210/ngx-spinner/gh-pages/assets/logo.png " >
35 <h1 align =" center " >NgxSpinner</h1 >
46</p >
57
6- A library with more than 50 different loading spinners for Angular 4/5/6/7/8. (https://napster2210.github.io/ngx-spinner/ )
7-
8- [ ![ ng5] ( https://img.shields.io/travis/rust-lang/rust.svg?style=flat-square )] ( )
98[ ![ Support] ( https://img.shields.io/badge/Support-Angular%204%2B-blue.svg?style=flat-square )] ( )
109[ ![ Support] ( https://img.shields.io/badge/Support-Angular%205%2B-blue.svg?style=flat-square )] ( )
1110[ ![ Support] ( https://img.shields.io/badge/Support-Angular%206%2B-blue.svg?style=flat-square )] ( )
1211[ ![ Support] ( https://img.shields.io/badge/Support-Angular%208%2B-blue.svg?style=flat-square )] ( )
1312[ ![ License] ( https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square )] ( )
1413[ ![ devDependency Status] ( https://img.shields.io/david/expressjs/express.svg?style=flat-square )] ( )
14+ [ ![ Gitter] ( https://badges.gitter.im/ngx-spinner/community.svg )] ( https://gitter.im/ngx-spinner/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge )
1515
1616## What's New
1717
18+ - Angular 9 support 🥳🥳🥳🥳
1819- Latest Angular Dependencies
19- - Dynamic ` z-index `
20- - Smooth animation while ` hide/show ` the spinner
21- - Debounce time to delay the spinner from hide
22- - BUG fixes
20+ - ` ng add ` command to add ` ngx-spinner ` to the project
21+ - Image Support(Finally) 🥳🥳🥳🥳
2322
2423Use appropriate version based on your Angular version.
2524
26- | Angular 4 | Angular 5 | Angular 6/7 | Angular 8 |
27- | ----------- | ----------- | ----------- | --------- |
28- | >= ` v1.2.0 ` | >= ` v2.0.0 ` | ` v7.2.0 ` | ` v8.1.0 ` |
25+ | Angular 4 | Angular 5 | Angular 6/7 | Angular 8 | Angular 9 |
26+ | ----------- | ----------- | ----------- | --------- | --------- |
27+ | >= ` v1.2.0 ` | >= ` v2.0.0 ` | ` v7.2.0 ` | ` v8.1.0 ` | ` v9.0.0 ` |
2928
3029## Table of contents
3130
@@ -34,17 +33,20 @@ Use appropriate version based on your Angular version.
3433- [ Browser Support] ( #browser-support )
3534- [ Features] ( #features )
3635- [ Demo] ( #demo )
37- - [ StackBlitz Demo: ] ( #stackblitz-demo )
36+ - [ StackBlitz Demo] ( #stackblitz-demo )
3837- [ Installation] ( #installation )
3938- [ Usage] ( #usage )
40- - [ NgxSpinner Service] ( #ngxspinner-service )
41- - [ NgxSpinner Component] ( #ngxspinner-component )
42- - [ NOTE:] ( #note )
39+ - [ Methods] ( #methods )
40+ - [ Available Options] ( #available-options )
41+ - [ Using Spinner Type] ( #using-spinner-type )
42+ - [ Using Custom Spinner] ( #using-custom-spinner )
43+ - [ NOTE] ( #note )
4344 - [ How to use type?] ( #how-to-use-type )
4445- [ Versioning] ( #versioning )
4546- [ Creator] ( #creator )
4647 - [ Yuvraj Chauhan] ( #yuvraj-chauhan )
4748- [ Future Plan] ( #future-plan )
49+ - [ Ask Me] ( #ask-me )
4850- [ Credits] ( #credits )
4951 - [ License] ( #license )
5052
@@ -56,7 +58,8 @@ Use appropriate version based on your Angular version.
5658
5759## Features
5860
59- - ** Angular 8** Support
61+ - ** Angular 9** Support
62+ - Custom spinner image support(gif), you can pass ` img ` tag
6063- Multiple Spinners
6164- Configurable option through service
6265- Fullscreen Mode(Enable/Disable)
@@ -68,7 +71,7 @@ Use appropriate version based on your Angular version.
6871
6972[ Working Demo] ( https://napster2210.github.io/ngx-spinner/ ) (Not Updated one)
7073
71- ### StackBlitz Demo:
74+ ### StackBlitz Demo
7275
7376- [ Normal Usage] ( https://stackblitz.com/edit/angular-kruvnm )
7477
@@ -94,19 +97,27 @@ Using yarn:
9497$ yarn add ngx-spinner
9598```
9699
100+ Using angular-cli:
101+
102+ ``` bash
103+ $ ng add ngx-spinner
104+ ```
105+
97106## Usage
98107
99108Import ` NgxSpinnerModule ` in in the root module(` AppModule ` ):
100109
101110``` typescript
111+ import { NgModule , CUSTOM_ELEMENTS_SCHEMA } from ' @angular/core' ;
102112// Import library module
103113import { NgxSpinnerModule } from " ngx-spinner" ;
104114
105115@NgModule ({
106116 imports: [
107117 // ...
108118 NgxSpinnerModule
109- ]
119+ ],
120+ schemas: [CUSTOM_ELEMENTS_SCHEMA ],
110121})
111122export class AppModule {}
112123```
@@ -139,23 +150,12 @@ Now use in your template
139150
140151See [ Demo] ( #demo )
141152
142- ## NgxSpinner Service
153+ ## Methods
143154
144155- ` NgxSpinnerService.show() ` Shows the spinner
145156- ` NgxSpinnerService.hide() ` Hides the spinner
146157
147- ## NgxSpinner Component
148-
149- ``` html
150- <ngx-spinner
151- bdColor =" rgba(51,51,51,0.8)"
152- size =" medium"
153- color =" #fff"
154- type =" ball-scale-multiple"
155- >
156- <p style =" font-size : 20px ; color : white " >Loading...</p >
157- </ngx-spinner >
158- ```
158+ ## Available Options
159159
160160- ** [ bdColor] ** : RGBA color format.
161161 To set background-color for backdrop, default ` rgba(51,51,51,0.8) ` where ` aplha ` value(0.8) is opacity of backdrop
@@ -171,10 +171,32 @@ See [Demo](#demo)
171171 To set name for spinner, default ` primary `
172172- ** [ zIndex] ** : For dynamic z-index
173173 To set z-index for the spinner, default ` 99999 `
174+ - ** [ template] ** : For custom spinner image
175+ To set custom template for the custom spinner, default ` null `
176+
177+ #### Using Spinner Type
178+ ``` html
179+ <ngx-spinner
180+ bdColor =" rgba(51,51,51,0.8)"
181+ size =" medium"
182+ color =" #fff"
183+ type =" ball-scale-multiple"
184+ >
185+ <p style =" font-size : 20px ; color : white " >Loading...</p >
186+ </ngx-spinner >
187+ ```
188+
189+ #### Using Custom Spinner
190+ ``` html
191+ <ngx-spinner
192+ bdColor =" rgba(0, 0, 0, 1)" >
193+ template="<img src =' https://media.giphy.com/media/o8igknyuKs6aY/giphy.gif' />"
194+ </ngx-spinner >
195+ ```
174196
175197---
176198
177- #### NOTE:
199+ #### NOTE
178200
179201- You can pass ` HTML ` code as loading text now, instead of input parameter(` loadingText ` ). Check above code for reference.
180202- If you want multiple ` ngx-spinner ` instance, just add ` name ` attribute with ` ngx-spinner ` component. But in this case, you've to pass that particular name of a spinner in ` show/hide ` method. Check [ Demo] ( #demo )
@@ -184,8 +206,9 @@ See [Demo](#demo)
184206this .spinner .show (" mySpinner" , {
185207 type: " line-scale-party" ,
186208 size: " large" ,
187- bdColor: " rgba(100,149,237, .8)" ,
188- color: " white"
209+ bdColor: " rgba(0, 0, 0, 1)" ,
210+ color: " white" ,
211+ template: " <img src='https://media.giphy.com/media/o8igknyuKs6aY/giphy.gif' />"
189212});
190213```
191214
@@ -213,10 +236,12 @@ For more information on SemVer, please visit http://semver.org.
213236
214237## Future Plan
215238
216- - Image support for spinner
217239- Interceptor Implementation
218240- Better DEMO website
219241
242+ ## Ask Me
243+ - Now you can directly send me a message on [ Gitter] ( https://gitter.im/ngx-spinner/community ) for any query/suggestion/updates
244+
220245## Credits
221246
222247Inspired by [ Load Awesome by Daniel Cardoso.] ( https://github.com/danielcardoso/load-awesome )
0 commit comments