
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
angular-busy2
Advanced tools
Show busy/loading indicators on any $http or $resource request, or on any promise.
Fork from original angular-busy (cgBusy) https://github.com/cgross/angular-busy
Added support for Angular 1.6.x
Renamed module to angular-busy.
Directive is now angular-busy. Old directive cg-busy(deprecated) still usable.
Default constant is now angularBusyDefaults. Old constant cgBusy(deprecated) still usable.
Install with Bower or download the files directly from the dist folder in the repo.
bower install angular-busy2 --save
Add dist/angular-busy.js
and dist/angular-busy.css
to your index.html.
Add angular-busy
as a module dependency for your module.
angular.module('your_app', ['angular-busy']);
Add your promise to $scope and reference that in the angular-busy
directive:
function MyCtrl($scope,$http,User) {
//using $http
$scope.myPromise = $http.get('...');
//if you have a User class based on $resource
$scope.myPromise = User.$save();
}
<!-- Use the simple syntax -->
<div angular-busy="myPromise"></div>
<!-- Use the advanced syntax -->
<div angular-busy="{promise:myPromise,message:'Loading Your Data',templateUrl:'mycustomtemplate.html'}"></div>
The angular-busy
directive expects either a promise or a configuration object.
In other words. You may do this:
<div angular-busy="myPromise"></div>
or this:
<div angular-busy="{promise:myPromise,message:'Loading',backdrop:false,templateUrl:'myAwesomeTemplate.html',delay:300,minDuration:700}"></div>
promise
- Required. The promise (or array of promises) that will cause the busy indicator to show. Also supports boolean and numbers (truthy values will show loading...)message
- Optional. Defaults to 'Please Wait...'. The message to show in the indicator. This value may be updated while the promise is active. The indicator will reflect the updated values as they're changed.backdrop
- Optional. Boolean, default is true. If true a faded backdrop will be shown behind the progress indicator.templateUrl
- Optional. If provided, the given template will be shown in place of the default progress indicatory template.delay
- Optional. The amount of time to wait until showing the indicator. Defaults to 0. Specified in milliseconds.minDuration
- Optional. The amount of time to keep the indicator showing even if the promise was resolved quicker. Defaults to 0. Specified in milliseconds.wrapperClass
- Optional. The name(s) of the CSS classes to be applied to the wrapper element of the busy sign/animation. Defaults to undefined
. Typically only useful if you wish to apply different positioning to the animation.The angular-busy
indicator is a regular Angular template. The templates have access to the scope where angular-busy
was declared so you may reference your local scope variables in your custom templates. Additionally, the scope is augmented with a $message
field containing the indicator message text.
The defaut values for message
, backdrop
, templateUrl
, delay
, and minDuration
may all be overriden by overriding the $injector
value for cgBusyDefaults
, like so:
angular.module('your_app').config(function(angularBusyDefaults) {
angularBusyDefaults.message = 'Loading Stuff';
angularBusyDefaults.backdrop = false;
angularBusyDefaults.templateUrl = 'my_custom_template.html';
angularBusyDefaults.delay = 300;
angularBusyDefaults.minDuration = 700;
angularBusyDefaults.wrapperClass = 'my-class my-class2';
});
Only the values you'd like overridden need to be specified.
delay
and minDuration
work together. If specified together, minDuration
will only take effect if the promise was active through the delay. For example, if delay
=200 and minDuration
=500 and the actual promise only took 100ms, no indicator will be shown. If the delay threshold is reached, the indicator will show for minDuration
ms rather than minDuration
minus delay
as it had been before.cgBusyDefaults
value.FAQs
Angular Busy 2
The npm package angular-busy2 receives a total of 88 weekly downloads. As such, angular-busy2 popularity was classified as not popular.
We found that angular-busy2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.