0

I am working in CRUD in angular 6. My job is to click edit button in the table where data is populated and then popup window show and edit it and table gets updated using angular 6.

Please help, thanks in advance.

I tried adding button as below

popup show open but not

HTML Code:

<td class="tbl2"> 
  <button type="button" (click)="OnClickFunction(employee.id)" class="btn btn-info" matTooltip="Click Edit Button">
   Edit
  </button> 
</td>

TS Code:

OnClickFunction(employeeId: string) { 
  alert('move to Edit page'); 
  this.router.navigate(['/edit/'+employeeId]); 
} 
Prashant Pimpale
  • 10,349
  • 9
  • 44
  • 84
Rose1988
  • 1
  • 1

1 Answers1

0

Component Code constructor(private data: DataService, public dialog: MatDialog){ }

openDialog(): void { const dialogRef = this.dialog.open(UserProfileComponent, { height: '500px', width: '400px', data: {UserInfo : this.authRslt } });

Html

<button (click)="openDialog()">Edit</button>
(You can pass particular id in click event)
Vipul Handa
  • 109
  • 1
  • 10