0.1.0 • Published 4 years ago
angularjs-async-filter v0.1.0
AngularJS Async Filter
How to use
This package is built as a UMD module. You can import it the way you like.
- import module
angular.module('MY_MODULE', [ 'AsyncFilterModule' ]);
- 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.
0.1.0
4 years ago