-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Template local variables with dash (-) in them do not work #1447
Comments
I believe that it behaves "as currently designed":
So, to make Now, while the above explains what is going on, it doesn't change the fact that things can get confusing. @mhevery do you think we can do things better here, apart from having clear docs on the subject? |
Yep, I understand the reasons why we don't support these. Can we find a
|
There are few ideas from @rkirov in #591 on how to tackle Dealing with |
I think this should work. (ie it should be fixed, @pkozlowski-opensource can you send out a PR for it.) <input #new-todo>
<button (click)="addTodo(newTodo.domElement.value)">Add Todo</button> |
I'm not sure how this could work as a browser will convert @mhevery are you suggesting that we should do case-insensitive lookup of local variables? |
@pkozlowski-opensource sorry, had a typo, fixed my example. Yes |
@mhevery but this works already (I mean, conversion of |
ohh, than there is nothing to do. :-), only to throw a useful error for the user. |
@mhevery right, the problem is that I don't really know when to throw an error:
We should be throwing if a user writes I'm available to discuss this in details if needed. |
I see, so there really is not any good way of doing this. Let's punt on this for now. |
Could this not be detected in the expression parser? Is there any way to have a valid variable name with a - there? |
@cehoffman browser parser turns all attributes to lower case before we get a chance to look at them. Angular parser can not detect |
not feasible. :-( |
@mhevery maybe just mention that in docs somewhere? I have created value |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
That is, this works:
But this does not:
Nor does this:
If it's not actually supposed to work, we should warn when users do this.
The text was updated successfully, but these errors were encountered: