I'm trying to use the dynamicDialog with a child component and pass an id to it.
code from parent component:
Code: Select all
const ref = this.dS.open(ChildComponent, {
data: {
id: '1'
},
header: 'Choose a Car',
width: '70%'
});
code childComponent:
Code: Select all
@Component({
selector: 'app-child',
templateUrl: './child.component.html',
styleUrls: ['./child.component.css'],
providers: [
DynamicDialogRef,
DynamicDialogConfig
]
})ChildComponent implements OnInit {
id:string = '';
constructor(
public ref: DynamicDialogRef,
public config: DynamicDialogConfig
) { }
ngOnInit(): void {
//id: this.config.id
console.log(this.config);
}
what am I doing wrong?
Greets Jevylein