Skip to content

Allow to use filter in conditional expression #5449

@sqal

Description

@sqal

What problem does this feature solve?

i am submitting this as a feature rather than a bug because I can't find any mention of why it isn't supported (maybe you have a reason) or similar bug report.

So.. currently, I can't use filters inside conditional statement, like this:

{{ prop !== null ? (prop | myFilter) : 'no data' }}

i can however use method instead of filter:

{{ prop !== null ? myFilter(prorp) : 'no data' }}

well I can also handle null value in my filter and I get my data filtered, but why not support it also in ternary expression? :)

Example: https://jsfiddle.net/Ljressro/

Thanks <3

What does the proposed API look like?

API wouldn't change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions