how sent data to dilaog angular material
// app.component.ts
import { Component } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { MyDialogModalComponent } from './modals/my-dialog-modal/my-dialog-modal.component';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'angular-material-tree-tutorial';
dialogValue: string;
sendValue: string;
constructor(
public dialog: MatDialog
) { }
openDialog(): void {
const dialogRef = this.dialog.open(MyDialogModalComponent, {
width: '250px',
backdropClass: 'custom-dialog-backdrop-class',
panelClass: 'custom-dialog-panel-class',
data: { pageValue: this.sendValue }
});
dialogRef.afterClosed().subscribe(result => {
console.log('The dialog was closed', result);
this.dialogValue = result.data;
});
}
}
Also in JavaScript:
- jquery loop over elements
- comment in jsp file
- queryselector name attribute
- create function javascript
- node js interview questions
- javascript add adjacent html
- check member role discordjs 12
- how to run a vue js hello world app in vue version 3
- javascript detect time on page
- electron disable menu
- react Refused to execute inline script because it violates the following Content Security Policy directive
- react materialize cdn
- create react element with string
- js get file name from path
- angular get response headers
- javascript for group object properties based on another property
- remove duplicates from array of objects javascript
- set navigation drawer to open by default react native
- jquery enable textbox
- promise catch
- javascript remove object from array
- javascript biggest number
- auto scroll to view react-native
- draw rectangle on javascript canvas