Quiz: Implementing CRUD Functionality in the Frontend

Test your knowledge about implementing CRUD functionality in this quiz.

1

Given an array of objects below:

let userData= [{
    "_id": "1",
    "name": "Latin America",
    "employee": {
      "_id": "5e77c50c4476e734d8b30dc6",
      "name": "Thomas",
      "lastName": "Smith",
      "_v": 0
    },
    "_v": 0
  },
  {
    "_id": "2",
    "name": "Oceania",
    "employee": {
      "_id": "5e76c50c4476e734d8b30dc6",
      "name": "Joe",
      "lastName": "Duff",
      "_v": 0
    },
    "_v": 0
  }]

Which option shows how you would use the *ngFor directive in Angular to loop through the data and display the object on the page?

A)
<tr *ngFor="let user of userData">
  <td>{{user.name}}</td>
  <td>{{user.employee.name}}</td>
</tr>
B)
<tr *ngIf="userData">
  <td>{{userData.name}}</td>
  <td>{{userData.employee.name}}</td>
</tr>
C)
<tr *ngFor="let user of userData">
  <td>{{userData.name}}</td>
  <td>{{userData.employee.name}}</td>
</tr>
D)
<tr *ngFor="let user of userData">
  <td>{user.name}</td>
  <td>{user.employee.name}</td>
</tr>
Question 1 of 80 attempted

Get hands-on with 1200+ tech skills courses.