-
Notifications
You must be signed in to change notification settings - Fork 42
Automatically show loader for router events
T edited this page Mar 16, 2020
·
3 revisions
If you want the loader to start automatically for navigating between your app routes, in your root AppModule
, do as follow:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { NgxUiLoaderModule, NgxUiLoaderRouterModule } from 'ngx-ui-loader';
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
NgxUiLoaderModule, // import NgxUiLoaderModule
NgxUiLoaderRouterModule, // import NgxUiLoaderRouterModule. By default, it will show foreground loader.
// If you need to show background spinner, do as follow:
// NgxUiLoaderRouterModule.forRoot({ showForeground: false })
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
exclude |
string[] | optional | null |
The loader is not showed when navigating to paths that start with these strings. Upper/lower case differences will be ignored. |
excludeRegexp |
string[] | optional | null |
An array of regexp strings. The loader is not showed when navigating to paths that match these regexps. Upper/lower case differences will be ignored. |
loaderId |
string | optional | master |
Specify the loader id which will showed when navigating between app routes. By default, loaderId = DefaultConfig.masterLoaderId
|
showForeground |
boolean | optional | true |
If true , foreground loader is showed. Otherwise, background loader is showed. |
- Demo & Examples
-
Getting Started
2.1 Install
2.2 ImportNgxUiLoaderModule
2.3 Includengx-ui-loader
component
2.4 Multiple loaders
2.5 UseNgxUiLoaderService
service - API - NgxUiLoaderService
- Attributes of NgxUiLoaderComponent
-
NgxUiLoaderBlurred directive
5.1 Usage
5.2 Attributes -
Custom Template
6.1 Usage -
Custom configuration for NgxUiLoaderModule
7.1 Usage
7.2 Parameters offorRoot()
method -
Automatically show loader for router events
8.1 Usage
8.2 Parameters offorRoot()
method -
Automatically show loader for http requests
9.1 Usage
9.2 Parameters offorRoot()
method - Changelog
- Credits
- License