-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
InvalidCharacterError with special character in attribute name #9566
Comments
Well not exactly.... JS and HTML both have spec that tell you what is a valid name or name. That being said, you are right for this particular case "Failed to execute 'setAttribute' on 'Element': 'ng-reflect-test$' is not a valid attribute name" is your browser complaining, not angular. Which means that the bug is in your browser. We will have to workaround this browser bug in Angular. Thanks for your report. |
Maybe it's more like a wish but I think that having own html parser (which supports e.g. camelCase) could also make possible to put JS names as inputs. Thanks! |
A workaround could be to set |
Sure. Thanks!
|
We need to sanitize the name so that all browsers are happy |
Can I take this one? My current line of thinking is that some form of reversible escaping will be necessary so there won't be conflicts between components with/without the special characters. |
When you provide an alternative binding string, such as |
Any news on whether or not this issue will be fixed? Or will this just be not an option as for HTML sanitation reasons? |
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. |
I'm submitting a ... (check one with "x")
Current behavior
Creating input name for a component like
test$
orsomething@
will produce error:Reproduction of the problem
http://plnkr.co/edit/p4AOGZsrmXgStWa9eDtf?p=preview
What is the expected behavior?
Valid JS name should also be a valid name in template.
Please tell us about your environment:
Mac OS X 10.11.5
The text was updated successfully, but these errors were encountered: