Closed jukka-varis closed 8 years ago
When using async filter on observable, value is evaluated to undefined instead of 0.
I'm using async to bind length of array to UI: scope.lengthObs = this.selectedItems.map(i => i.length); Where selectedItems is Rx.Observable<any[]>
scope.lengthObs = this.selectedItems.map(i => i.length);
Html looks like this: <span>{{ lengthObs | async:this }}</span>
<span>{{ lengthObs | async:this }}</span>
When array is not empty, async filter works fine and lenght of array is printed on UI. If array is empty, UI is empty instead of expected 0.
This is line causing the symptom: return values[inputId] || undefined;
return values[inputId] || undefined;
Thanks for pointing this out. The || undefined was not necessary so it has been fixed now. Added some tests while I was looking into it ;)
|| undefined
When using async filter on observable, value is evaluated to undefined instead of 0.
I'm using async to bind length of array to UI:
scope.lengthObs = this.selectedItems.map(i => i.length);
Where selectedItems is Rx.Observable<any[]>Html looks like this:
<span>{{ lengthObs | async:this }}</span>
When array is not empty, async filter works fine and lenght of array is printed on UI. If array is empty, UI is empty instead of expected 0.
This is line causing the symptom:
return values[inputId] || undefined;