I want to show a specific device data when i open the dialog, but first, i need to pass the device.key from my Component to the Dialog Component and then run the service that'll get the device data, let me show you the code:
list-device.html:
  <ng-container matColumnDef="info">
    <th mat-header-cell *matHeaderCellDef><strong>Details</strong></th>
    <td mat-cell *matCellDef="let device; let i = index;">
      <button mat-mini-fab (click)="openDialog(device.key)" style="background-color: darkcyan;">
        <mat-icon>info</mat-icon>
      </button>
    </td>
  </ng-container>
list-device.ts:
  openDialog(id: string){
    this.dialog.open(ListDialogComponent)
    console.log(id)
  }
list-device-dialog.ts:
  dataSource: any = [];
  constructor(
    public fb: FormBuilder,
    private location: Location,
    private deviceService: DeviceService,
    private actRoute: ActivatedRoute,
    private router: Router
  ) {
    this.deviceService.GetDevice(**the device key**).valueChanges().subscribe(data => {
      console.log(data);
      this.dataSource.push(data)
    })
  }
 
    