Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 866 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 866 Bytes

AngularFire subscribe & filter

angularfire-subscribe-filter is an example usage of filtering AngularFire results after subscribing to snapshotChanges() of a firebase collection.

Installation

angularfire2
angular6+
RxJS6+

Usage

Usefull when you a already have Range filters or an orderBy clause on the on the original CollectionReference.

    this.yourService.getSnapshotChanges().subscribe((resObj: YourInterface[]) => { 
      this.activeItem = resObj.filter(item => item.status === 'active' );
      this.completedItem = resObj.filter(item => item.status === 'completed' );
      this.archivedItem = resObj.filter(item => item.status === 'archived' );
    });

Contributing

Pull requests & Improvement Suggestions are welcome

AppAgility Ltd https://appagility.co.nz

License

MIT