0.3.2 • Published 4 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 --save
Dependencies
- @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 test
Author
CBC
License
Copyright © 2018 CBC Licensed under the MIT license.
0.3.0
4 years ago
0.3.2
4 years ago
0.2.4
4 years ago
0.2.3
5 years ago
0.2.2
5 years ago
0.2.1
6 years ago
0.2.0
6 years ago
0.1.13
6 years ago
0.1.12
6 years ago
0.1.10
6 years ago
0.1.9
6 years ago
0.1.8
6 years ago
0.1.7
6 years ago
0.1.6
6 years ago
0.1.5
6 years ago
0.1.4
6 years ago
0.1.3
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago
0.0.11
6 years ago
0.0.10
6 years ago
0.0.9
6 years ago
0.0.6
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago
0.0.3
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago