I learning Angular, and I am using call an API to receive data to populate my table.

The records of the table are not displaying. But using console.log I can see them in the console.

This is my component.ts

```
export class ListaUtentiComponent implements OnInit {

  displayedColumns =  ['id', 'username'];
  @Input()
  dataSource: MatTableDataSource<any>;

  utenti: Utenti [];
  @ViewChild(MatPaginator) paginator: MatPaginator;
  @ViewChild(MatSort) sort: MatSort;

  constructor(public rest: ApiService, private router: Router) { }

  ngOnInit(): void {
    this.dataSource = new MatTableDataSource();
    this.getUser();
    this.dataSource.paginator = this.paginator;
    this.dataSource.sort = this.sort;
  }

 getUser() {
    this.rest.getUsers().subscribe((data) => {
      console.log(data);
      alert(data);
      this.dataSource['data']; 
      return data;

    });
  }
}

```

And this is my component.html

```
<div class="mat-elevation-z8">
  <table mat-table class="full-width-table" matSort aria-label="Elements" [dataSource]="dataSource">

<ng-container matColumnDef="id">
      <th mat-header-cell *matHeaderCellDef mat-sort-header>Id</th>
      <td mat-cell *matCellDef="let ut">{{ut.id}}</td>
    </ng-container>

   <ng-container matColumnDef="username">
      <th mat-header-cell *matHeaderCellDef mat-sort-header>Nome</th>
      <td mat-cell *matCellDef="let ut">{{ut.name}}</td>
    </ng-container> 

    <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
    <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
  </table>

  <mat-paginator #paginator
      [length]="dataSource?.data.length"
      [pageIndex]="0"
      [pageSize]="10"
      [pageSizeOptions]="[10, 20]">
  </mat-paginator>
</div> 

```

Please help me I don't know what is wrong.