Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

alianza-dev/az-promise-show

Repository files navigation

az-promise-show

npm version npm downloads Build Status Code Coverage Gitter

Directives to show or hide an element based on the resolved state of an angular promise.

See the example and the example code

Docs

Usage

Install the module

$ npm install az-promise-show --save

Or just download it from the dist directory.

Depend on the module

angular.module('yourModule', ['azPromiseShow']);

az-promise-show

<div az-promise-show="aPromise">
  I'm only shown when the promise is in flight
</div>

az-promise-hide

<div az-promise-hide="anotherPromise">
  I'm only show when the promise is not in flight
</div>

az-promise-show-hide-class

<div az-promise-show="aPromise" az-promise-show-hide-class="display-none">
  By default, azPromiseShow uses 'ng-hide', but you can specify your own if you want.
  Or, you can use the azPromiseShowOptions service.
</div>

azPromiseShowOptions

angular.module('yourModule').run(function(azPromiseShowOptions) {
  azPromiseShowOptions.className = 'display-none';
});

About

Show/hide an element based on a promise's resolved status

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors