
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
ng4-loader-bar
Advanced tools
Angular component that shows a loading bar at the top of a component or module
npm install ng4-loader-bar --save
Using SystemJS to load your files may require a update to your config:
System.config({
map: {
'ng4-loader-bar': 'node_modules/ng4-loader-bar/bundles/index.umd.js'
}
});
style.css into your web page or app. "styles": [
"../node_modules/ng4-loader-bar/bundles/style.css"
]
<ng4-loader-bar></ng4-loader-bar> component tag within the component you want the loading bar to appear:<div class="my-component">
<h1>Component with a loading bar</h1>
<ng4-loader-bar></ng4-loader-bar>
...
</div>
The default styles are:
color: 'red';
height: '2px';
AngularLoadingBarModuleImport AngularLoadingBarModule.forRoot() in the NgModule of your application.
import {NgModule} from '@angular/core';
import {AngularLoadingBarModule} from 'ng4-loader-bar';
@NgModule({
imports: [
BrowserModule,
AngularLoadingBarModule.forRoot()
],
bootstrap: [AppComponent]
})
export class AppModule {
}
Using a shared module allows AngularLoadingBarModule to be exported without having to import it multiple times.
@NgModule({
imports: [
BrowserModule,
AngularLoadingBarModule.forRoot()
],
exports: [BrowserModule, AngularLoadingBarModule],
})
export class SharedModule {
}
AngularLoadingBarService in your Angular applicationAngularLoadingBarService from ng4-loader-bar(within your node_modules directory) into your component code:import {Component} from '@angular/core';
import {AngularLoadingBarService} from 'ng4-loader-bar';
@Component({
selector: 'app',
template: `
<div>Hello world</div>
<button (click)="startLoadingBar()">Start Loading</button>
<button (click)="stopLoadingBar()">Stop Loading</button>
<button (click)="completeLoadingBar()">Complete Loading</button>
<ng4-loader-bar></ng4-loader-bar>
`
})
export class AppComponent {
constructor(private angularLoadingBarService: AngularLoadingBarService) { }
startLoadingBar() {
this.angularLoadingBarService.start();
}
stopLoadingBar() {
this.angularLoadingBarService.stop();
}
completeLoadingBar() {
this.angularLoadingBarService.complete();
}
}
ng4-loader-bar to tailor to your applicationExample:
<ng4-loader-bar [color]="'green'" [height]="'6px'"></ng4-loader-bar>
You can use the following methods to control the SlimLoadingBar via instance of SlimLoadingBarService:
start() - Start the loading progress. Use the callback function as an parameter to listed the complete event.stop() - Stop the loading progress. This method will pause the progress of the loading bar; start() will resume animation from the current position.reset()- Reset the position of loading progress to 0. This method will stop the current progress animation; using start() after reset() will start a new animation from 0.complete() - Set the progress to 100% and hide the progress bar.FAQs
Angular component that shows a loading bar at the top of a component or module
We found that ng4-loader-bar 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
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.