My component is set up to accept an @Input
in this way:
@Input() item:Item; // causing error!
The input value is passed to the component like so:
<my-component [item]="thatItem"></my-component>
When using strict mode, I am encountering the following compiler error:
Property 'item' has no initializer and is not definitely assigned in the constructor.
Is there a solution to this issue without resorting to filling it with dummy data and still maintaining strict mode compliance (if that is indeed the root cause), while relying on the input being populated by whoever is constructing the component? I do not have a default value to assign to item
, and both null
and undefined
options have proved unsuccessful.