refactor(core): update NG0303 error message (#62363)

This adds mention of the `input()` signal function
to the error message.

PR Close #62363
This commit is contained in:
Shuaib Hasan Akib
2025-06-29 22:49:39 +06:00
committed by Jessica Janiuk
parent a06ec75735
commit 85d6474d8c
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -530,7 +530,7 @@ export class ComponentRef<T> extends AbstractComponentRef<T> {
if (ngDevMode && !hasSetInput) {
const cmpNameForError = stringifyForError(this.componentType);
let message = `Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;
message += `Make sure that the '${name}' property is annotated with @Input() or a mapped @Input('${name}') exists.`;
message += `Make sure that the '${name}' property is declared as an input using the @Input() decorator or the input() function.`;
reportUnknownPropertyError(message);
}
}
@@ -377,7 +377,7 @@ describe('ComponentFactory', () => {
fixture.componentRef.setInput('doesNotExist', '');
const msgL1 = `NG0303: Can't set value of the 'doesNotExist' input on the 'NoInputsCmp' component. `;
const msgL2 = `Make sure that the 'doesNotExist' property is annotated with @Input() or a mapped @Input('doesNotExist') exists.`;
const msgL2 = `Make sure that the 'doesNotExist' property is declared as an input using the @Input() decorator or the input() function.`;
expect(console.error).toHaveBeenCalledWith(msgL1 + msgL2);
});