I am trying to pass an input value when reusing a component, the problem is that it will be a "hardcoded" map of strings and I am unsure how to pass that:
<continue-p
[additionalInfo]="{ "myString": "string", "myNumber": "4" }">
<p>
Paragraph
</p>
</continue-p>
and the input field looks like this:
@Input()
additionalInfo?: Map<string, string>;
PS I am not sure if there is a better structure for passing such information to components, please recommend.
Record<string, string>. Maps are totally different.Record<string, string>is (structurally) equivalent to{ [key: string]: string }. So yes, it would support multiple entries. You can read this type as "a type where all of its keys are strings and all of its values are strings".