# RjSpinner

This library was generated with https://github.com/angular/angular-cli version 9.1.13.


## Installation

`rj-spinner` is available via [npm](https://www.npmjs.com/package/rj-spinner) and [yarn](https://yarnpkg.com/en/package/rj-spinner)

Using npm:

```bash
$ npm install rj-spinner --save
```

Using yarn:

```bash
$ yarn add rj-spinner
```

Using angular-cli:

```bash
$ ng add rj-spinner
```

## Usage

Import `RjSpinnerModule` in in the root module(`AppModule`):

```typescript
import { RjSpinnerModule } from 'rj-spinner';

@NgModule({
  imports: [
    RjSpinnerModule,
  ],
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}


```

Add `RjSpinnerService` service wherever you want to use the `rj-spinner`.

```typescript
import { RjSpinnerService } from 'rj-spinner';

class AppComponent implements OnInit {
  constructor(private spinner: RjSpinnerService) {}

  ngOnInit() {
    /** spinner starts on init */
    this.spinner.show();

    setTimeout(() => {
      /** spinner ends after 5 seconds */
      this.spinner.hide();
    }, 5000);
  }
}
```

Now use in your template

```html
<rj-spinner ></rj-spinner>
```

See [Demo](#demo)

## Methods

- `RjSpinnerService.show()` Shows the spinner
- `RjSpinnerService.hide()` Hides the spinner
