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
Binding to unknown properties (such as Aria attributes) results in error. #4385
Comments
DOM elements don't have So the error is correct and we definitively want to throw for unknown properties since binding to a non-existing properties wouldn't have any effect - this is a user error most of the time. |
Cool, I was not aware of the I do think, however, that there is an opportunity to improve the message we give when the binding misses the *EXCEPTION: Can't bind to 'foo' since it isn't a known property of the '' element and there are no matching directives with a corresponding property. If this is an attribute, make sure to prefix its name with 'attr.' * This issue could be used to track improving this message. |
…pting to bind to an known property Currently we alert the user that no such property exists for the given element, but we could indicate that if user is attempting to bind to an attribute then the attr. prefix should be used. Part of angular#4385
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. |
Binding to unknown properties such as Aria attributes result in error. For example:
Will result in the following exception when the component whose template includes this code is loaded:
EXCEPTION: Can't bind to 'ariaExpanded' since it isn't a known property of the '' element and there are no matching directives with a corresponding property
It turns out, aria attributes often include dashes, so we are converting to ariaExpanded which ins't really correct (perhaps there is a escaping mechanism I'm not aware of?'). That is not the root cause of this, though, as binding to anything unknown will cause the same issue:
EXCEPTION: Can't bind to 'foo' since it isn't a known property of the '' element and there are no matching directives with a corresponding property
Please let me know if a plunker is needed and I'll create one.
The text was updated successfully, but these errors were encountered: