npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kken94/ngx-progress

v2.3.1

Published

The most powerful and customizable progress bar for Angular ✨

Downloads

31

Readme

@kken94/ngx-progress

Build Status npm version CodeClimate Codacy code style: prettier semantic-release license Donate

NgxProgress is customizable Angular library for showing a progress bar during http request and/or routing change (or all you want) and prevent user interaction.

Changelog

Please read the changelog

Installation

If you use npm

npm install @kken94/ngx-progress --save

If you use yarn

yarn add @kken94/ngx-progress

Usage

Choose the most suitable module for you.

There are two modules:

  • NgxProgressModule (manage progress bar by yourself)
  • NgxProgressHttpModule (import progress bar and intercept http requests)

Warning: to use http module import that in your app.module.ts, then import NgxProgressModule where you want to use progress bar.


import { NgxProgressHttpModule } from '@kken94/ngx-progress';

@NgModule({
  declarations: [AppComponent],
  imports: [
    ...
    NgxProgressHttpModule,
    ...
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}

and place it into the element you want to cover.

Note: If you want to use overlay be sure that the parent element has position:relative Overlay works with position:absolute, top:0, left:0

<div style="position: relative">
  <ngx-progress></ngx-progress>
  <table></table>
</div>

Features

  • NgxProgress supports multiple requests. If during the bar progress another request is fired, bar will not reset and keep going until all requests are completed.
  • NgxProgress can be instantiated multiple times. Only the deepest one will be displayed

Requests filtering

You can filter the HTTP requests that would like to be avoided by the interceptor by providing an array of regex patterns:

  import { NgxProgressHttpModule } from '@kken94/ngx-progress';
  
  @NgModule({
    declarations: [AppComponent],
    imports: [
      ...
      NgxProgressHttpModule.forRoot(['auth', '[a-zA-Z]']),
      ...
    ],
    bootstrap: [AppComponent],
  })
  export class AppModule {}

Configuration

Customization

| Input | Description | Default value | | ---------------------- | ------------------ | --------------- | | color | | #0984e3 | | showSpinner | | true | | showBar | | true | | indeterminate | Indeterminate style like Material | false | | barHeight | | 1px | | spinnerDiameter | | 10px | | initialValue | From 1 to 100 | undefined | | overlay | Show overlay that prevent user click | true | | overlayValue | From 0 to 1 | 1 | | spinnerSpeed | From 1 to 10 | 4 |

Emitters

NgxProgress provides also some emitters.
You have to inject NgxProgressService and subscribe end$ or start$

Manually show and hide progress

In NgxProgressService there are four methods:

  • start(): start bar if no request is in progress or add new request to queue of the bar already shown
  • end(): complete the bar if all requests are finished
  • reset(): force bar to start from zero
  • terminate(): force bar to terminate even if some requests are in progress

Enable and disable progress bar

In NgxProgressService:

  • enable(): enable bars if it has been previously disabled
  • disable(): disables all the bars that will not be shown until the next enabling

and provide isEnabled variable to know if progress bar is enabled.
Enabled by default.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Donate

Offer me a coffee 😁

donate