Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getInvoices() {
- this.invCollection = this.afs.collection('invoices');
- this.invoices = this.invCollection.snapshotChanges().pipe(
- shareReplay(1),
- map(actions => {
- return actions.map(action => ({
- key: action.payload.doc.id,
- ...action.payload.doc.data()
- }))
- })
- )
- this.invList = this.invoices.source;
- <mat-form-field class="ffield">
- <mat-select (selectionChange)="getInv($event)" placeholder="Choose invoice">
- <mat-option *ngFor="let invoice of invoices | async; trackBy: trackByFn" [value]="invoice.key">{{invoice.invNo}}</mat-option>
- </mat-select>
- </mat-form-field>
- getInv(e) {
- this.sID = e.value; //id of selected invoice
- //TODO filter this.invList observable }
- this.invList.pipe(map(aaa => {return aaa.map(bbb => ())}), filter(flt => flt.key === this.sID)).subscribe(sss => (console.log(sss.invNo)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement