ngQueue is an AngularJS module for managing synchronous and asynchronous task queues in AngularJS 1.x applications. Current version 0.3.1 is stable but has seen no releases since 2014. It provides a $queueFactory service to create queues with configurable concurrency limits and an optional 'deferred' mode that uses setImmediate() to prevent browser freezing during heavy tasks. Unlike generic queue libraries, it integrates directly with AngularJS's $q promises and $timeout, making it natural for AngularJS projects. Tasks can be enqueued, removed, and queues cleared programmatically.
npm install ng-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates how to create a queue with $queueFactory, enqueue synchronous and asynchronous tasks, and handle promise resolution.
Use a modern queue library like p-queue or bull for Angular 2+ applications.
Ensure a setImmediate polyfill is included, or avoid the deferred option.
Do not use the deferred option if strict sequencing without delay is required.
Use the returned object only for queue.remove(taskHandle). To chain after task completion, return a promise from the task function itself.
Ensure the ngQueue script is included in your HTML and that your AngularJS app declares 'ngQueue' as a dependency: angular.module('myApp', ['ngQueue']).Include the ngQueue script after AngularJS but before your app code. Check the script URL or use a CDN.
Do not call .then() on the result of enqueue(). To react to task completion, return a promise from the task function and handle it via $q promises.
Avoid the deferred option when tasks cause immediate $scope updates. Use non-deferred queue or wrap updates in $scope.$applyAsync().