0

i want to display the data using a modal popup with mat-dialog, but the data has not appeared in the popup, how to display the data...???

this for modal ts

    export interface DialogData {
      noktp: string;
    }
this connection for popup

        openDialog() {
            this.dialog.open(Popupform, 
            {
              data: {
                noktp: '',
          }
            });
          }

        

this component popup

    @Component({
      selector: 'popupform',
      templateUrl: 'popupform.html',
    })
    export class Popupform {
      Forms: any =[];
      constructor(
        public fb: FormBuilder,
        public dialog: MatDialog,
        private formservice: FormService,
        private _formBuilder: FormBuilder,
        @Inject(MAT_DIALOG_DATA) public data: DialogData
      ) {
      }
    }

this for popup html

<h3 mat-dialog-title>Data Formulir</h3>
<div mat-dialog-content class="mat-typography">
    <div class="container">
        <form action="">
            <div class="row">
                <div class="span4 well">
                    <table class="invoice-head">
                        <tbody>
                            <tr *ngIf="data.noktp">
                                <td class="pull-right"><strong>No KTP</strong></td>
                                <td>{{data.noktp}}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </form>
    </div>
</div>
A Myf
  • 11
  • 3
  • Does this answer your question? [How to pass data to dialog of angular material 2](https://stackoverflow.com/questions/42664974/how-to-pass-data-to-dialog-of-angular-material-2) – Mikefox2k Jul 03 '21 at 18:17

0 Answers0