Hi I have a html where I need to pass the object name/string in the html. For example:
HTML
<app-family
(callDad) ="callFamily($event, {{family.Dad}})"" // I want to pass "Dad" as a string
(callSon) ="callFamily($event, {{family.Son}})"" // I want to pass "Son" as a string but get it from the object so it is not error prone
(callMom) ="callFamily($event, {{family.Mom}})"" // I want to pass "Mom" as a string
(callDaughter) ="callFamily($event, {{family.Daughter}})"" // I want to pass "Daugher" as a string
></app-customer>
Component Class
export class Family {
family: Family;
}
Model
export class Family{
Dad: string
Mom: string
Son: string
Daughter: string
}
I want to get the name of the property and pass it in the html. Like Dad, mom, son and daughter?