Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

exactBinding isn't so exact #925

Closed
Closed
@owenmead

Description

@owenmead

Like the idea of exact binding, but my impression is that it would bind exactly

Say I have the following binding:
{{ data_source.model.volts|number:2 }}

I would expect to use either "volts" or the whole binding expression.

Problem is that I also have:
{{ data_source.model.volts_average|number:2 }}

Since exactBinding uses the following regex it matches both volts and volts_average
var matcher = new RegExp('([^a-zA-Z\\d]|$)' + binding + '([^a-zA-Z\\d]|^)');

Thinking the following would make the most sense
by.binding - Using the simple contains search (also doesn't break anything)
by.exactBinding - Matches the whole binding, including the filter etc
by.regExBinding - Pass in a regular expression to match against

Be happy to send a pull request if others think this is a good idea

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions