feat(angular): add booleanAttribute transform to IonItem inputs - #30825
feat(angular): add booleanAttribute transform to IonItem inputs#30825Advikkhandelwal wants to merge 1 commit into
Conversation
This change allows using boolean attributes like <ion-item button detail> instead of requiring explicit bindings like <ion-item [button]="true" [detail]="true">. Applied to IonItem's button, detail, and disabled inputs using Angular's booleanAttribute transform function. Closes ionic-team#30822
|
Someone is attempting to deploy a commit to the Ionic Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for putting this together, and apologies for the long silence on it. We ended up taking a different route to the same goal. That landed upstream in stenciljs/output-targets#842 and will ship in the next So I'm going to close this one in favor of that. The new behavior is opt-in, so turning it on for Ionic is a separate change on our side. I'm leaving #30822 open to track that part. Thanks again for digging into this, it moved the problem along! |
Description
This PR implements
booleanAttributetransforms for IonItem's boolean inputs, allowing cleaner syntax as requested in #30822.Problem
Currently, Angular developers have to use explicit bindings for boolean attributes:
This generates IDE warnings and is more verbose than the desired syntax.
Solution
Applied Angular's
booleanAttributetransform to IonItem'sbutton,detail, anddisabledinputs. This allows:Changes
@stencil/angular-output-targetfrom^0.10.0to^1.1.1IonItemcomponent in both regular and standalone Angular proxiesbutton,detail, anddisabledfrom@ProxyCmpand@Componentinputs arrays@Input({ transform: booleanAttribute })decorators with getters/settersTesting
✅ Core package builds successfully
✅ Angular package builds successfully
✅ Standalone package builds successfully
✅ All linting checks pass
✅ TypeScript compilation without errors
✅ No breaking changes to existing API
Type of Change
Closes #30822