Live data from Hacker News

Show HN: ngProgress - slim, site-wide progressbar for AngularJS, without jQuery

victorbjelkholm.github.io

31–36 of 36 posts

Re: Show HN: ngProgress - slim, site-wide progressbar for AngularJS, without jQuery

#32
post #31

Thank your for making a proper AngularJS directive and not just some shim-wrapper for an existing JQuery component. I wish this was more the standard than the exception with AngularJS components. Let's move foward!

Except it's not a directive but a provider! But thanks and I absolutely agree, more ports to native Javascript instead of using jQuery in Angular!

Re: Show HN: ngProgress - slim, site-wide progressbar for AngularJS, without jQuery

#33
post #18
post #16

Earlier quoted context omitted.

I think you missed a subtlety of nprogress, where it never fills the last 10 (or so) pixels unless complete is fired, presumably so that it doesn't make you think loading is finished until it's really, really finished.

Oh, yes, I totally missed that and that seems very reasonable actually. I've now changed (commit 34e3c16 http://git.io/4MeJNg ) so the start-method will stop at 95% instead of stopping at 100%.

One technique that I used when building my own progress indicator is using a maths function which approaches 0 as the progress bar approaches 100% and use the result to increase the progress.

That way, the progress bar appears moving slower and slower but never actually hits 100%. I think that's better than having the progress bar completely stalled at 95%. See code here: https://github.com/buunguyen/rainbow.js/blob/master/src/rain....

Re: Show HN: ngProgress - slim, site-wide progressbar for AngularJS, without jQuery

#35
post #34
post #29

This would be easy to recreate without the need of Angular or jQuery...

In case you're interested, I built one that doesn't use Angular or jQuery: http://buunguyen.github.io/rainbow.js/

The most interesting thing for me about the frameworks is how they all use different methods of rendering the bar itself.

So far I've seen straight css, canvas, and css transitions.

Re: Show HN: ngProgress - slim, site-wide progressbar for AngularJS, without jQuery

#36
I had a ton of trouble a few months ago to create a reliable global loading indicator for all requests in Angular, this doesn't seem to implement that, correct? One would have to explicitly call p.start() as the installation says, I wonder if that global intercept is more doable nowadays?

There does exist a suggestion somewhere in the google groups (that later became a gist/drop in directive) but with the new versions Ng IIRC it broke and threw me off during my tests.

Post reply on HN