-
Notifications
You must be signed in to change notification settings - Fork 2.3k
exactBinding isn't so exact #925
Comments
@hankduan what do you think about including |
I feel like having three locators for binding is excessive, but even if we include
|
+1 for it needing to be exact up until whitespace or a |
+1 for exact being exact up until the first My suggestion for the regEx option was to provide a bit more flexibility, but you are probably right that just exact and contains is enough. At least until someone comes up with a use case to need the regEx. |
merged with f9082d0 |
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
The text was updated successfully, but these errors were encountered: