I have object array :
{"-LTYJbW1B3mhrdc6C64N":{"done":0,"name":"Job2","pt":5},"-LTYJcSOUh07SQcixP4x":{"done":0,"name":"Job3","pt":5}}
As it seems, there is two objects with random keys (--LTYJbW1B3mhrdc6C64N) , I want to get these KEYS, how I can do that ?
HTML :
<div class="task-block" *ngFor="let task of objectValues(team.tasks)">
<p >{{task.name}}</p>
<button mat-raised-button (click)="updateTask(task)">Done!</button>
<i class="material-icons deletetask">close </i></div>
TS :
objectValues(obj) {
if(obj){
console.log(JSON.stringify(obj))
return Object.values(obj || {});
}
}
updateTask(task){
console.log(task.key); //here I want to get task.key
}
