0.3.2 • Published 6 years ago
ngx-xenc-loading v0.3.2
NgxXencLoading
This library was generated with Angular CLI version 9.0.6.
Install
Install with npm
$ npm i ngx-xenc-loading --saveDependencies
- @angular/common
- @angular/core
Usage
@NgModule({
imports: [NgxXencLoadingModule.forRoot()],
providers: [
{
provide: HTTP_INTERCEPTORS,
useClass: XcHttpClientInterceptor,
multi: true,
},
],
bootstrap: [AppComponent],
})
export class AppModule {}- Inject
constructor(public loadService: NgxXencLoadingService) {}- Start
this.loadService.start();- Complete
this.loadService.complete();- Stop (Complete All)
this.loadService.stop();- Set Progress Value
this.loadService.set(12);- Auto Increment Progress Value
// Start , Auto Increment 0 ~ 90%
this.loadService.autoIncrement();
// Stop Auto Increment
this.loadService.stopAutoIncrement();- Other
this.loadService.getPendingRequest();
this.loadService.getProgress();
this.loadService.isBusy();
this.loadService.isIdle();
this.loadService.subscribe({
next: (event: XcLoadEvent) => {},
error: err => {},
complete: () => {},
});Other
XcLoadEventType
| Name | Description |
|---|---|
| Start | at the same time multiple starts, only the first will emit. |
| Stop | always is last event. |
| Progress | progress value change. |
| Error |
XcLoadEvent
| property | Description |
|---|---|
| type | enum XcLoadEventType |
| value | progress value |
| error | type is error, refer to the original event. (Example : RouteEvent) |
NgxXencLoadingRouteModule
@NgModule({
imports: [NgxXencLoadingModule.forRoot(), NgxXencLoadingRouteModule],
})
export class AppModule {}| Route Event | Mapped to XcLoadEvent |
|---|---|
| NavigationStart | XcLoadEventType.Start. |
| NavigationError | XcLoadEventType.Error. |
| NavigationCancel | XcLoadEventType.Error. |
| NavigationEnd | XcLoadEventType.Start. |
Running tests
Install dev dependencies:
$ ng testAuthor
CBC
License
Copyright © 2018 CBC Licensed under the MIT license.
0.3.0
6 years ago
0.3.2
6 years ago
0.2.4
6 years ago
0.2.3
7 years ago
0.2.2
7 years ago
0.2.1
7 years ago
0.2.0
7 years ago
0.1.13
7 years ago
0.1.12
7 years ago
0.1.10
7 years ago
0.1.9
7 years ago
0.1.8
7 years ago
0.1.7
7 years ago
0.1.6
7 years ago
0.1.5
7 years ago
0.1.4
7 years ago
0.1.3
7 years ago
0.1.1
7 years ago
0.1.0
7 years ago
0.0.11
7 years ago
0.0.10
7 years ago
0.0.9
7 years ago
0.0.6
7 years ago
0.0.5
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago