Skip to content

Commit d5c65f5

Browse files
committed
Merge branch 'release/v9.0'
2 parents f7dc063 + f1cc842 commit d5c65f5

16 files changed

Lines changed: 9076 additions & 7020 deletions

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"codelyzer",
55
"devkit",
66
"jasminewd",
7+
"ngcc",
78
"packagr",
9+
"rgba",
810
"tsickle"
911
]
1012
}

README.MD

Lines changed: 59 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
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

2423
Use 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

99108
Import `NgxSpinnerModule` in in the root module(`AppModule`):
100109

101110
```typescript
111+
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
102112
// Import library module
103113
import { NgxSpinnerModule } from "ngx-spinner";
104114

105115
@NgModule({
106116
imports: [
107117
// ...
108118
NgxSpinnerModule
109-
]
119+
],
120+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
110121
})
111122
export class AppModule {}
112123
```
@@ -139,23 +150,12 @@ Now use in your template
139150

140151
See [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)
184206
this.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

222247
Inspired by [Load Awesome by Daniel Cardoso.](https://github.com/danielcardoso/load-awesome)

angular.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
"options": {
1515
"tsConfig": "projects/ngx-spinner/tsconfig.lib.json",
1616
"project": "projects/ngx-spinner/ng-package.json"
17+
},
18+
"configurations": {
19+
"production": {
20+
"tsConfig": "projects/ngx-spinner/tsconfig.lib.prod.json"
21+
}
1722
}
1823
},
1924
"test": {
@@ -48,6 +53,7 @@
4853
"build": {
4954
"builder": "@angular-devkit/build-angular:browser",
5055
"options": {
56+
"aot": true,
5157
"outputPath": "dist/ngx-tester",
5258
"index": "projects/ngx-tester/src/index.html",
5359
"main": "projects/ngx-tester/src/main.ts",
@@ -84,6 +90,10 @@
8490
"type": "initial",
8591
"maximumWarning": "2mb",
8692
"maximumError": "5mb"
93+
},
94+
{
95+
"type": "anyComponentStyle",
96+
"maximumWarning": "6kb"
8797
}
8898
]
8999
}
@@ -167,4 +177,4 @@
167177
}
168178
},
169179
"defaultProject": "ngx-spinner"
170-
}
180+
}

0 commit comments

Comments
 (0)