@developer-partners/ngx-loading-spinner
v1.0.8
Published
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.2.6.
Downloads
9
Maintainers
Readme
@developer-partners/ngx-loading-spinner
This project was generated with Angular CLI version 11.2.6.
Basic Usage
- Install the library
npm install @developer-partners/ngx-loading-spinner
- Import in your module:
import { LoadingSpinnerModule } from '@developer-partners/ngx-loading-spinner';
@NgModule({
imports: [
LoadingSpinnerModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
- Use it in HTML (isLoading should be a public booolean property in your component)
<dp-loading-spinner *ngIf="isLoading" message="Loading, please wait.."></dp-loading-spinner>
Advanced Configuration
The loading spinner component comes with a default spinner. If you need to replace it with your own spinner, you can just replace our default provider
import { LoadingSpinnerModule } from '@developer-partners/ngx-loading-spinner';
@NgModule({
imports: [
LoadingSpinnerModule
],
providers: [
{
provide: LoadingSpinnerConfig,
useFactory: () => {
return {
component: YourCustomSpinnerComponent
}
}
}
],
bootstrap: [AppComponent]
})
export class AppModule { }
The YourCustomSpinnerComponent in the example above should contain the custom HTML and CSS for your own loading spinner.
Credits
Developer Partners, Inc.