Skip to content

Observable<number> evaluates undefined on 0 #3

@jukka-varis

Description

@jukka-varis

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions