Bugfix: How to handle naming collision between an autoFlashState sig...
Documentation for Sessions
🐛 Bugfix: How to handle naming collision between an autoFlashState sig...
Date: 2026-03-26
Time: 16:20:02 UTC
Session: gspace1-271.12
Agent: angular
Confidence: 97%
Status: ✅ Documented
📋 Decision Context
Question:
How to handle naming collision between an autoFlashState signal property and an @Input() setter with the same name in an Angular Element?
Task: Fix duplicate member warning between signal and @Input in Angular Elements
🎯 Decision Made
Chosen:
Use
@Input('zoom') set zoomAttr(v: string)— give the setter a different property name but keep the HTML attribute alias matching the desired attribute name. The public signal keeps the canonical name (zoom) for template/method use.
Options Considered:
- @Input('zoom') set zoomAttr(v) (chosen)
- Rename signal property to _zoom (breaks template readability)
- Drop the @Input entirely and use only flash-persisted default
- Use a different attribute name like initial-zoom
💭 Reasoning
When a class declares readonly zoom = autoFlashState(...) AND @Input() set zoom(v: string), TypeScript/esbuild emits a Duplicate member "zoom" warning because both occupy the same property slot. Renaming the setter to zoomAttr while keeping the @Input('zoom') alias resolves the collision: the HTML attribute zoom="week" still maps correctly via the alias, the signal property zoom is used in the template and methods, and esbuild compiles without warnings. This is the general pattern whenever a flash-persisted signal and an @Input share the same conceptual name.
📁 Files Involved
libs/libs-structural/platform-elements-angular/src/lib/components/gantt-widget/gantt-widget.component.ts
🔗 Related
- Decision ID:
dev_1774542002724_tzo8t3j - Session: 271
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation