az-promise-show
v1.1.2
Published
angular directives to show or hide an element based on the state of a promise
Downloads
12
Readme
az-promise-show
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';
});