-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom attribute options binding breaks if interpolation is used #136
Comments
Thanks for the feature request. It makes sense. This could probably be done but it will require a bit of work in vCurrent to ensure no regressions come with it. I'll be implementing it in vNext first, where we have a better testing baseline, and then see if it can be backported. Unfortunately I cannot provide a timeframe yet. In the meantime, you might want to try using a template expression instead. It's a little less clean perhaps, but it should work: <div foo="path: `something/${someProperty}`"> Do let me know if it doesn't :) |
Sounds good 👍 I actually tried the template string too, just forgot to mention it. |
I just ran into this while trying to use something like customattribute=${$index} and discovered that in my simple case, I can use "this.value" rather than element.attributes.[attributename].value in my custom attribute. Big win, however I don't know how to define my custom attribute so that this.value is defined. The typescript examples in the documentation imply that this.value would exist, however I don't see that it extends anything. Here is the example: @autoinject
} |
@elmt1 The property is added during binding, so you can simply declare it on your class to make TS happy. |
I'm submitting a bug report
Library Version:
[email protected]
[email protected]
[email protected]
JSPM OR Webpack AND Version
Webpack 4.28.3
Browser:
Chrome 73 | Safari 12 | ...
Current behavior:
Let's assume I have a custom attribute
foo
with a bindable propertypath
of type string.This works - meaning that the bindable property is set to the value of
someProperty
:This does not work - meaning that the bindable property is never set and remains undefined:
Expected/desired behavior:
I expected the
path
property to be set to the same value in both cases - and I most certainly didn't expect it to remain undefined when bound using the second approach.Shouldn't this work?
In the examples above, the first approach is of course the cleanest anyway.
However, when binding something like a path containing a dynamic segment, the second approach would be cleaner - and it is certainly something one would expect to just work:
The text was updated successfully, but these errors were encountered: