Open
Description
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
No
Description
The @Input
decorator tells Angular that a property can be written to in a template. However, if you add the @Input
decorator to a readonly
property, no error is reported. We should report an error, since mixing these two concepts doesn't make sense.
@Component(...)
export class UserProfile {
@Input() readonly name: string;
}
At time of writing, there are 37 occurrences of this in Google we'd have to clean up. Not sure if this is prevalent enough to warrant an ng update
schematic (which would probably just remove readonly
).
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/angular-ivy-j8vlxf?file=src%2Fapp%2Fhello.component.ts
EDIT (April 2024): This does not apply to signal-based inputs