Is it possible to console log a specific attribute of an object when clicking on the edit button using the code below?
Please provide guidance on how to utilize the index to access the value of "name". Refer to the last line in the code with the comment.
export class AppComponent {
name = 'Angular';
enableEdit = false;
enableEditIndex = null;
wantedValue = '';
backendData = [{
"name": 'Target',
"value": '100',
"description": 'abc'
},
{
"name": 'Size',
"value": '20',
"description": 'def'
},
{
"name": 'Industry',
"value": '40',
"description": 'ghi'
}]
enableEditMethod(e, i) {
this.enableEdit = true;
this.enableEditIndex = i;
console.log(i, e);
this.wantedValue = //the selected name value
console.log(// this.wantedValue //); //I want to get the name if the index (object) that is to be editted. e.g I
want "Industry" in console.
}
}