docs(angular): document boolean input changes in the v10 migration guide - #4744
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ShaneK
approved these changes
Sep 22, 2026
| + <ion-item [button]="items.length > 0"></ion-item> | ||
| ``` | ||
|
|
||
| Coercion also moves from Stencil to Angular, which changes the result for numbers. `0` and `NaN` previously became `false` and now become `true`, matching Angular's own `booleanAttribute`. Without `strictTemplates` there is no compile error to catch the binding above, so an empty list now disables the item rather than enabling it. Coercing the expression fixes both the type error and the runtime change. |
Member
There was a problem hiding this comment.
Suggested change
| Coercion also moves from Stencil to Angular, which changes the result for numbers. `0` and `NaN` previously became `false` and now become `true`, matching Angular's own `booleanAttribute`. Without `strictTemplates` there is no compile error to catch the binding above, so an empty list now disables the item rather than enabling it. Coercing the expression fixes both the type error and the runtime change. | |
| Coercion also moves from Stencil to Angular, which changes the result for numbers. `0` and `NaN` previously became `false` and now become `true`, matching Angular's own `booleanAttribute`. Without `strictTemplates` there is no compile error to catch the binding above, so an empty list now renders the item as tappable rather than plain. Coercing the expression fixes both the type error and the runtime change. |
This is the same correction as the one on the framework PR, since the paragraph came across with it. The example binds button rather than disabled.
| <ion-item [button]="true"></ion-item> | ||
| ``` | ||
|
|
||
| Declaring the transform also turns on type checking for these inputs, which Angular did not do before. The generated component wrappers declare no class fields, so Angular had nothing to check a binding against and accepted any value. A binding that passes something outside `boolean | string | null | undefined` now fails to compile. The common case is a truthiness binding on a number: |
Member
There was a problem hiding this comment.
This holds under strictTemplates, though the caveat doesn't turn up until the coercion paragraph further down, where it's attached to a different point. Could it go here instead? Someone without strictTemplates reads this, expects a compile error, gets none, and never reaches the part that actually affects them.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue URL: ionic-team/ionic-framework#31442
What is the current behavior?
The v10 migration guide has no Angular section. Boolean inputs on Ionic components are getting an input transform in v10, and nothing documents it.
What is the new behavior?
Adds Getting Started > Angular > Boolean Inputs to the v10 migration guide, covering:
<ion-item button>, which previously failed to compile[button]="items.length"now fails withTS2322and needs coercingnullandundefinedpass through instead of coercing tofalse, the opposite of Angular's ownbooleanAttribute, because components likeion-itemand sheetion-modaltreat "not set" as a third stateDoes this introduce a breaking change?
Other information
N/A