I'm trying to understand how Typescript and HTML are passing data.
(Typescript)
public getContactByTradingPartnerId(tradingPartnerId: number):string {
const map = {
1001 : "[email protected]",
2 : "[email protected]",
11 : "[email protected]"
}
return map[tradingPartnerId] ?? "A contact has not been found for this trading partner."
(HTML)
<div class="example-element-description">
{{element.tradingPartnerId}}
</div>
How can I pass the element.tradingpartnerid to the typescript function getContactByTradingPartnerId so that it renders the contact? (Example. the element.tradingPartnerId is 1001 so it renders [email protected] on the UI).
elementcomes?