Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@cgross/angular-busy
Advanced tools
> Show busy/loading indicators on any $http or $resource request, or on any promise.
Show busy/loading indicators on any $http or $resource request, or on any promise.
Install with Bower or download the files directly from the dist folder in the repo.
bower install angular-busy --save
Add dist/angular-busy.js
and dist/angular-busy.css
to your index.html.
Add cgBusy
as a module dependency for your module.
angular.module('your_app', ['cgBusy']);
Add your promise to $scope and reference that in the cg-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 cg-busy="myPromise"></div>
<!-- Use the advanced syntax -->
<div cg-busy="{promise:myPromise,message:'Loading Your Data',templateUrl:'mycustomtemplate.html'}"></div>
The cg-busy
directive expects either a promise or a configuration object.
In other words. You may do this:
<div cg-busy="myPromise"></div>
or this:
<div cg-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.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 cg-busy cg-busy-animation
. 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 cg-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').value('cgBusyDefaults',{
message:'Loading Stuff',
backdrop: false,
templateUrl: 'my_custom_template.html',
delay: 300,
minDuration: 700,
wrapperClass: 'my-class my-class2'
});
Only the values you'd like overriden 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
> Show busy/loading indicators on any $http or $resource request, or on any promise.
The npm package @cgross/angular-busy receives a total of 50 weekly downloads. As such, @cgross/angular-busy popularity was classified as not popular.
We found that @cgross/angular-busy 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.