-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix: add non-null assertions for non-nullable input bindings #20136
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
Conversation
Due to a bug in the template type checker, binding expressions that include `undefined` in their type which are bound to directive inputs that don't accept `undefined` would not be reported as an error, if the directive declares at least one coercion member using `ngAcceptInputType`. angular/angular#38273 fixes this bug, which uncovers some template issues. Long-term, it would be best if the directives would be updated to include `undefined` in an input's type as appropriate. This would require a larger effort and is likely to introduce some breaking changes to public API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Marking as safe since it's only syntax-level changes in our own templates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Going to do a presubmit for this one anyway out of an abundance of caution |
The changes in angular/components#20136 are required to allow the framework tests to succeed.
The changes in angular/components#20136 are required to allow the framework tests to succeed. PR Close #38273
…#38273) The changes in angular/components#20136 are required to allow the framework tests to succeed. PR Close angular#38273
…#38378) The changes in angular/components#20136 are required to allow the framework tests to succeed. PR Close #38273 PR Close #38378
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. |
Due to a bug in the template type checker, binding expressions that include
undefined
in their type which are bound to directive inputs that don't acceptundefined
would not be reported as an error, if the directive declares atleast one coercion member using
ngAcceptInputType
. angular/angular#38273fixes this bug, which uncovers some template issues.
Long-term, it would be best if the directives would be updated to include
undefined
in an input's type as appropriate. This would require a largereffort and is likely to introduce some breaking changes to public API.