Skip to content

Commit e5725b2

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents d1b6c64 + d33f8f9 commit e5725b2

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

README.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img height="200px" width="200px" style="text-align: center;" src="https://cdn.rawgit.com/me-majidi/ng2-loading-spinner/e284608f/assets/logo.svg">
2+
<img height="200px" width="200px" style="text-align: center;" src="https://raw.githubusercontent.com/me-majidi/ng2-loading-spinner/master/src/assets/logo.png">
33
</p>
44
<a name="ng2-loading-spinner" />
55
<h1>Ng2-loading-spinner</h1>
@@ -50,30 +50,30 @@ import { NgModule } from '@angular/core';
5050
import { Ng2LoadingSpinnerModule } from 'ng2-loading-spinner'
5151

5252
@NgModule({
53-
imports: [ Ng2LoadingSpinnerModule ]
53+
imports: [ Ng2LoadingSpinnerModule.forRoot({}) ]
5454
})
5555
export class TestModule { }
5656
```
57-
then, use `ng2-loading` directive on element which you want spinner:
57+
then, use the `ng2-loading` directive on the element you want to have a spinner on:
5858
```html
5959
<div class="card"
6060
[ng2-loading]="showSpinner">
6161
...
6262
</div>
6363
```
64-
directive expects a boolean for showing and removing Loading spinner:
64+
the directive expects a boolean for showing and removing Loading spinner:
6565
``` typescript
6666
@Component({
6767
selector : 'app.component',
6868
templateUrl: './app.component.html',
6969
styleUrls : [ './app.component.css' ]
7070
})
7171
export class AppComponent {
72-
showSpinner: boolean = false;
72+
showSpinner: boolean = true;
7373

7474

7575
constructor() {
76-
setTimeOut(() => {
76+
setTimeout(() => {
7777
this.showSpinner = false;
7878
}, 1500);
7979
}
@@ -99,6 +99,7 @@ template | TemplateRef | Optional | If provided, the custom template will be sho
9999
<a name="Configurable options" />
100100

101101
#### Configurable options
102+
Config options can be set globally using the forRoot module import statement as well as being passed into each loader instance.Options passed to the instance of loader will override each global options.
102103

103104
Option | Required | type | Default value | Description | Examples |
104105
--- | --- | --- | --- | --- | ---- |
@@ -161,6 +162,18 @@ xl |
161162
<a name="Example 1 - with custom configuration options" />
162163

163164
#### Example 1 - with custom configuration options
165+
```typescript
166+
import { NgModule } from '@angular/core';
167+
import { Ng2LoadingSpinnerModule } from 'ng2-loading-spinner'
168+
169+
@NgModule({
170+
imports: [ Ng2LoadingSpinnerModule.forRoot({
171+
backdropColor : 'rgba(0, 0, 0, 0.3)',
172+
spinnerColor : '#fff',
173+
}) ]
174+
})
175+
export class TestModule { }
176+
```
164177

165178
``` typescript
166179
import { Component } from '@angular/core';
@@ -178,8 +191,6 @@ export class Example1Component {
178191

179192
loadingConfig: INg2LoadingSpinnerConfig = {
180193
animationType : ANIMATION_TYPES.dualCircle,
181-
backdropColor : 'rgba(0, 0, 0, 0.3)',
182-
spinnerColor : '#fff',
183194
spinnerPosition: 'left',
184195
backdropBorderRadius: '15px',
185196
spinnerSize: 'md',

0 commit comments

Comments
 (0)