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

ng-http-progress

v1.0.4

Published

$http interceptor spinner for angular.js

Downloads

3

Readme

Angular $http Progress Bar

YouTube like top attached progress bar to show $http requests in progress (automatic)

bower npm downloads ![preview](https://img.shields.io/badge/preview-click here-green.svg?style=flat-square)


How does it work?

When you include thatisuday.ng-http-progress module to your app's dependencies, you will automatically get progress bar whenever you send ajax requests through $http service.

You can change the background color and other options in config block using $httpProgressOpsProvider provider of ng-http-progress module.

In general, whenever your app send one or more $http requests, progress bar will show up and progress will start. At each second, progress bar width will increment by 5% until it reaches 90%. At 90% progress, progress bar will pause and stay like that until all ajax requests finishes. When all ajax requests finishes, progress bar will reach 100% progress and disappear. If all ajax requests finishes before progress reaches 90%, it will jump to 100% and disappear. You can change pause value of 90% to any number between 0 - 100 in config phase.

It consumes only 2kb (gzipped) and it's very hackable.


Install

bower

bower install ng-http-progress

npm

npm install ng-http-progress

include ng-http-progress.js and ng-http-progress.css from dist directory.


Config / Options

angular
.module('demo', ['thatisuday.ng-http-progress'])
.config(function($httpProgressOpsProvider){
	$httpProgressOpsProvider.setOps({
		background: '#b91f1f',
		autoPauseAt : 90,
		http : true
	});
})

all above values are default values, you can avoid any options or entire config block if you want.

| option | value | role | | ------ | ----- | ---- | | background | hex/rgba | background color of progress bar | | startAt | 0 - 100 | start progress bar with initial progress | | autoPauseAt | 0 - 100 | where progress bar will pause until requests resolve | | http | true/false | automatic show/hide progress bar for $http requests |


Events

If you wish to show progress bar other than just $http requests, then you can use events to show/hide/pause/resume progress bar. Ex. $rootScope.$emit('$httpProgressStart');

| event name | emit from | role | | ------ | ----- | ---- | | $httpProgressStart | $rootScope | show/start progress bar | | $httpProgressPause | $rootScope | pause progress bar | | $httpProgressResume | $rootScope | resume progress bar | | $httpProgressRestart | $rootScope | restart progress bar | | $httpProgressStop | $rootScope | stop/hide progress bar |


Build on your own

You can build this directive with your own customization using gulp.

  1. Go to repository's parent directory and install all node dev dependencies using npm install --dev.
  2. Make sure you have gulp install globally. Else use npm install -g gulp to install gulp globally.
  3. All css for this repository has been generated using sass (.scss), so you need to spend 5 mins to learn basics of sass.
  4. To build or watch the changes, use command gulp build or gulp watch

Contributions and Bug reports

  1. Please create an issue if you need some help or report a bug.
  2. Take a pull request to add more features or fix the bugs. Please mention your changes in the PR.
  3. Please make sure you recommend good practices if you came/come across any or if something could have been better in this module.