0.0.4 • Published 5 years ago

@ognanshissi/ngx-loader v0.0.4

Weekly downloads
3
License
-
Repository
-
Last release
5 years ago

Angular loader NgxLoader

Getting Started

NgxLoader help you handle page loading, posting data to the server loading state and more others example of loading more easier.

  • You have svg loaders integrated
  • Loader handle with a service state

Installation

If you are a fan of npm

npm install @ognanshissi/ngx-loader OR npm i @ognanshiss/ngx-loader

If you are a fan of yarn

yarn add @ognanshissi/ngx-loader

Usage

  • Add NgxLoaderModule inside app.module.ts imports array
import {NgxLoaderModule, NgxLoaderTypeEnum} from '@ognanshissi/ngx-loader';

@NgModule({
  // ..
  imports: [
    // ...
    NgxLoaderModule.forRoot({
      type: NgxLoaderTypeEnum.AUDIO
    })
    // ...
  ]
  // ...
})
export class AppModule {}
  • Add <ngx-loader></ngx-loader> component inside app.component.html with configuration.
  <ngx-loader></ngx-loader>
  <router-outlet></router-outlet>
  • Handle the loader state inside app.component.ts
import {NgxLoaderService} from '@ognanshissi/ngx-loader'

@Component({
  //...
})
export class AppComponent implement OnInit {

  constructor (
    private ngxLoaderService: NgxLoaderService
  ){}

  ngOnInit(){
    // How you can trigger loader
    this.ngxLoaderService.setLoader(true);
    setTimeOut(() => {
      this.ngxLoaderService.setLoader(false);
    }, 5000)
  }
}
0.0.3

5 years ago

0.0.4

5 years ago

0.0.1

5 years ago