0.0.2 • Published 4 years ago

ngx-waiting v0.0.2

Weekly downloads
8
License
-
Repository
-
Last release
4 years ago

Support License devDependency Status

Angular version 9.

| Angular 9


| >=v9.0.1

Browsers support

IE / EdgeChrome
IE11, Edgelast 2 versions

Demo

Show Case

Installation

ngx-waiting is available via npm

Using npm:

$ npm install ngx-waiting --save

Usage

Import NgxWaitingModule in in the root module(AppModule):

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
// Import library module
import { NgxWaitingModule } from "ngx-waiting";

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

Add NgxWaitingService service wherever you want to use the ngx-waiting.

import { NgxWaitingService } from "ngx-waiting";

class AppComponent implements OnInit {
  constructor(private waiting: NgxWaitingService) {}

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

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

Now use in your template

<ngx-waiting></ngx-waiting>

Methods

  • NgxWaitingService.show() Shows the waiting
  • NgxWaitingService.hide() Hides the waiting

Available Options

Using waiting Type

<ngx-waiting
  bgColor="rgba(51,51,51,0.8)"
  [fullScreen]=false
  color="#fff"
  type="timer"
  name= "demo"
>
  <p>Loading...</p>
</ngx-waiting>

Author

Aishvarya Shrivastava

Thanks to

Load Awesome by Daniel Cardoso.

License

ngx-waiting is MIT licensed.