-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
[RFC] Ability to not double specify on bindable match on name #1259
Comments
At the moment, we already have the short hand |
What we could consider further, is to apply the same shorthand for normal bindings as well: <input value.bind="value"> Is it good to enable: <input value.bind > |
So would that include |
Yes we should apply on shorthand and @zewa666 stuff should be naturally included |
If we are to allow shorthand everywhere, what should we do with the special case: <td colspan.bind> because
<td colspan.bind="colspan"> or <td colspan.bind="colSpan"> Similar to other properties like Note that we are camel-casing the prop for shorthand bindable on custom element: <name-tag first-name.bind> equals: <name-tag first-name.bind="firstName"> |
@bigopon (same goes for the other examples). if that were the case, it would behave exactly how you explained for
I think |
It's a productivity helper. Writing <div inner-h-t-m-l.bind="myHtml"> compared to <div innerhtml.bind="myHtml"> Maybe we don't have to provide all the mapping, just only special one for |
I think the correct kebab-case transformation of
I'll try to dig into the official definition later. but regardless of that, I agree with you that 1 rule to remember is the way to go. |
I remember raising this about a year ago and I could have sworn that we had this already. Is that not the case currently @bigopon ? |
It is the case for bindable properties. This is to consider making it available everywhere. Probably custom attribute is an exception: <div square.bind> Should be understood as <div square> (no value /empty string) |
Why is the case of custom attribute different? |
<div square.bind=''> is actually the same with <div square.bind>
Im not 100% sure on this, a v1 behavior carried over. Maybe we don't have to/shouldn't keep it. |
@avrahamcool I just came across another example while we a mapping may look good: the <label html-for.bind="..."> or just <label for.bind="..."> |
Isnt this similar to |
you are right. you convinced me that we must have a map of some sort. I guess that |
My common comment for both of these 2 comments is that our template should look like html, instead of a mix of html + JS, unless it's explicitly done so by the devs.
Yes, everything is camel-case-ized by default, and |
@bigopon AFAIK, the proposed shorthand in the original post already works. Can this be closed? |
💬 RFC
Allow user to ignore specifying the same property name if matched on the attribute binding to.
🔦 Context
This would shrink html and make more readable
💻 Examples
Current State
Proposed
The text was updated successfully, but these errors were encountered: