Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
ngx-ui-loader
Advanced tools
An all-in-one and fully customizable loader/spinner for Angular 5, 6 and 7+ applications. It supports foreground, background spinner/loader, indicative progress bar and multiple loaders.
An all-in-one and fully customizable loader/spinner for Angular 5, 6 and 7+ applications. It supports foreground, background spinner/loader, indicative progress bar and multiple loaders.
Available spinners:
NgxUiLoaderModule
ngx-ui-loader
component NgxUiLoaderService
serviceforRoot()
methodforRoot()
methodforRoot()
methodLive demo here.
Multiple loaders demo here.
Minimal setup here on Stackblitz.
Simple setup for multiple loaders here on Stackblitz.
Live demo source code here on Stackblitz.
If you like it, please star on Github.
Install ngx-ui-loader
via NPM, using the command below.
$ npm install --save ngx-ui-loader
$ yarn add ngx-ui-loader
$ npm install --save ngx-ui-loader@1.2.5
NgxUiLoaderModule
Import the NgxUiLoaderModule
in your root application module AppModule
:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { NgxUiLoaderModule } from 'ngx-ui-loader';
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
// Import NgxUiLoaderModule
NgxUiLoaderModule,
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
ngx-ui-loader
componentAfter importing the NgxUiLoaderModule
, use ngx-ui-loader
component in your root app template:
<ngx-ui-loader></ngx-ui-loader>
See Attributes of NgxUiLoaderComponent for more details about attributes.
You can skip this step if you do not want to use multiple loaders
After importing the NgxUiLoaderModule
, use ngx-ui-loader
component in your template:
<div style="position: relative"> <!-- the position of the parent container must be set to relative -->
<!-- It is really important to set loaderId for non-master loader -->
<ngx-ui-loader [loaderId]="'loader-01'"></ngx-ui-loader>
</div>
<div style="position: relative"> <!-- the position of the parent container must be set to relative -->
<!-- It is really important to set loaderId for non-master loader -->
<ngx-ui-loader [loaderId]="'loader-02'"></ngx-ui-loader>
</div>
<ngx-ui-loader></ngx-ui-loader> <!-- this is master loader and its loaderId is "master" by default -->
<!-- Note 1: If you really want to change loaderId of master loader, please use NgxUiLoaderModule.forRoot() method. -->
<!-- Note 2: Your application can only have ONE master loader.
The master loader should be placed in your app root template, so you can call it anywhere in you app. -->
See simple setup for multiple loaders here on Stackblitz.
NgxUiLoaderService
serviceAdd NgxUiLoaderService
service wherever you want to use the ngx-ui-loader
:
import { Component, OnInit } from '@angular/core';
import { NgxUiLoaderService } from 'ngx-ui-loader'; // Import NgxUiLoaderService
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
constructor(private ngxService: NgxUiLoaderService) { }
ngOnInit() {
this.ngxService.start(); // start foreground spinner of the master loader with 'default' taskId
// Stop the foreground loading after 5s
setTimeout(() => {
this.ngxService.stop(); // stop foreground spinner of the master loader with 'default' taskId
}, 5000);
// OR
this.ngxService.startBackground('do-background-things');
// Do something here...
this.ngxService.stopBackground('do-background-things');
this.ngxService.startLoader('loader-01'); // start foreground spinner of the loader "loader-01" with 'default' taskId
// Stop the foreground loading after 5s
setTimeout(() => {
this.ngxService.stopLoader('loader-01'); // stop foreground spinner of the loader "loader-01" with 'default' taskId
}, 5000);
}
}
See API - NgxUiLoaderService for more details.
ngx-ui-loader
, please give it a :star:FAQs
An all-in-one and fully customizable loader/spinner for Angular applications. It supports foreground, background spinner/loader, indicative progress bar and multiple loaders.
The npm package ngx-ui-loader receives a total of 25,826 weekly downloads. As such, ngx-ui-loader popularity was classified as popular.
We found that ngx-ui-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.