Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

passing data to a MatDialog component using inject

this.dialogRef = this.dialog.open(someComponent, {
  data: {
    myInfo: infoId
  }
});

//on the MatDialog component 
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Inject } from '@angular/core';

constructor(
   @Inject(MAT_DIALOG_DATA) public data: any
) { }

ngOnInit() {
  // will log the entire data object
  console.log(this.data)
}
Comment

PREVIOUS NEXT
Code Example
Typescript :: typescript throw not implemented exception 
Typescript :: get key of enum typescript 
Typescript :: angular closest element 
Typescript :: how to find how many commits i have done 
Typescript :: angular send mailto html 
Typescript :: transport unknown socket.io 
Typescript :: angular output send click event to parent 
Typescript :: supertest typescript 
Typescript :: check if two lists have overlap python 
Typescript :: react routes not working after build 
Typescript :: how to create dict key with list default -1 
Typescript :: typescript-eslint disable 
Typescript :: functional testing types? 
Typescript :: how remove decimal points in java 
Typescript :: how to separate elements in list python 
Typescript :: typescript comments 
Typescript :: how to get url parameters snapshots in angular 
Typescript :: 10 digit mobile number validation pattern in javascript 
Typescript :: pnpjs get items from list 
Typescript :: typescript object to array 
Typescript :: typescript function as parameter 
Typescript :: typescript string to number 
Typescript :: add active class when element exists into an array vuejs 
Typescript :: extending an interface in typescript 
Typescript :: give all element in a list starts with string 
Typescript :: react typescript cheat sheet 
Typescript :: how to compare two lists element by element in python and return matched element 
Typescript :: calling contract from ethereum 
Typescript :: html table to csv 
Typescript :: typescript namespace 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =