Skip to content

About

Observable/Promise async pipe for angularjs

Resources

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

AngularJS Async Filter

npm version CircleCI MIT license

How to use

This package is built as a UMD module. You can import it the way you like.

  1. import module
angular.module('MY_MODULE', [ 'AsyncFilterModule' ]);
  1. Use in template. Input object can be either a Promise or Observable.
<span>{{ myPromise$ | async:this }}</span>
<span>{{ myObservable$ | async:this }}</span>

Use with CDN

<script src="https://unpkg.com/angularjs-async-filter@0.1.0/lib/index.min.js"></script>

⚠️ Caveat

This filter will handle subscription and unsubscription upon $scope is created and destroyed. But please be mindful that reassign the input of the filter will make previous object not being garbadge collected until the controller is destroyed.

If possible, using ng-if to toggle the filter would be more performant and memory-friendly.

About

Observable/Promise async pipe for angularjs

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages