Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
angular-bluebird-promises
Advanced tools
This is a drop in replacement for $q that makes the bluebird API compatible with angulars subset of $q then simply swaps it out.
With this module you can use all of bluebirds additional promise methods on the $q service, the full list can be found here:
https://github.com/petkaantonov/bluebird/blob/master/API.md
The library depends on angularJS and Bluebird.
It is recommended that you install the library and its dependencies through bower:
bower install --save angular-bluebird-promises
You will then need to include the JS files for the plugin:
<script src="bower_components/bluebird/js/browser/bluebird.js"></script>
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-bluebird-promises/dist/angular-bluebird-promises.min.js">
And finally add the module dependency in your AngularJS app:
angular.module('myModule', ['mwl.bluebird']);
Simply use $q as you normally would. It will function exactly as before, however you will now have bluebirds additional API methods available as well on all promises throughout your angular app.
Please note there is a slight difference between angulars $q and this implementation. Regular $q allows a notify callback to be passed as a second argument to .finally, however this project does not allow this. I would be happy to accept a PR though that adds this functionality (hint hint!)
angular.module('mwl.example', ['mwl.bluebird']).run(function($q, $http) {
var promises = [
$http.get('test/angular.json'),
$http.get('test/bluebird.json')
];
//Note the use of spread which isn't available normally on $q
$q.all(promises).spread(function(angular, bluebird) {
console.info('\\m/ It worked! \\m/', angular.data.name, bluebird.data.name);
}).catch(console.error);
});
npm install -g gulp
npm install
while current directory is this repoRun gulp
to build the project files in the dist folder
Run gulp watch
to start a development server with livereload on port 8000.
The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Replaces $q with bluebirds promise API
The npm package angular-bluebird-promises receives a total of 178 weekly downloads. As such, angular-bluebird-promises popularity was classified as not popular.
We found that angular-bluebird-promises 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.