I've created an array of object and in some of these objects I need to refer to the properties of that object inside of it like this:
let fields = [
{
"ATTRIBUTE_NAME": "PERSON_NAME",
"FIELD_NAME": "name"
"ATTRIBUTE_ID": 1,
"RULES": [
{
"MSG":`${this.ATTRIBUTE_NAME} is not valid`,
"NAME": "VALID_VALUES",
}
]
},
{
"ATTRIBUTE_NAME": "PERSON_JOB",
"FIELD_NAME": "job"
"ATTRIBUTE_ID": 2,
"RULES": [
{
"MSG":`${this.ATTRIBUTE_NAME} is not valid`,
"NAME": "VALID_VALUES",
}
]
}
] But this keyword returning undefined! I want the "MSG" property to pick up the attribute name and populate it for me. Does anybody know how to capture it inside the template string?