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
Angular property binding begin with colon should throw error #44185
Comments
In angular for property binding, you should use [] not the colon.Please see the documentation over here. <button [disabled]="xxxx">Disabled Button |
I know I should use [], but I think this behavior is weird. this code sample run in plain html will not disable button, but in angular it will. If angular doesn't support this syntax(begin with :), why not just throw compile error or keep the same behavior with plain html ? |
The colon is interpreted as XML namespace separator, where the namespace prefix is left empty. That is not valid according to the XML specification, but Angular's parser/compiler accepts it to mean the default namespace. |
when attribute begin with colon, it should not be parsed as namespace since namespce is empty PR Close angular#44185
when attribute begin with colon, it should not be parsed as namespace since namespce is empty PR Close angular#44185
when attribute begin with colon, it should not be parsed as namespace since namespce is empty PR Close angular#44185
when attribute begin with colon, it should not be parsed as namespace since namespce is empty PR Close angular#44185
when attribute begin with colon, it should not be parsed as namespace since namespce is empty PR Close angular#44185
when attribute begin with colon, it should not be parsed as namespace PR Close angular#44185
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
No
Description
with this code, Angular will treat the button as disabled(xxxx is any random string)
First, is there any document that Angular support this code style begin with colon(:) for property binding ?
If not, I think it is better to throw error
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version
)No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: