When attempting to pass a value to an @Input()
in Angular, I am encountering some issues. Unfortunately, I am struggling to identify what mistake I might be making.
<my-component
[foo]="bar"
></my-component>
private _foo = ''
@Input() foo(value: any) {
this._foo = value?.toString() || ''
}
Can anyone spot the error here?
The error message reads:
Type 'string' is not assignable to type '(value: any) => void'.