az-promise-show

1.1.2 • Public • Published

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';
});

Package Sidebar

Install

npm i az-promise-show

Weekly Downloads

2

Version

1.1.2

License

MIT

Last publish

Collaborators

  • kentcdodds
  • themcmurder