Hi,
I'm using entryComponents to pass the data from my component to Material
dialog component in Angular 6,
The problem is that the object type is not recognized in my dialog omponent:
@ngModule:
...
entryComponents: [DeleteDialogComponent]
myComponent:
openDialog(){
let dialogRef = this.dialog.open(DeleteDialogComponent
, {
width: '250px',
data: {deviceToDelete: this.selectedDevice}
});
dialogRef.afterClosed().subscribe(result => {
this.selectedDevice = result;
});
}
dialogComponent:
constructor(
public dialogRef: MatDialogRef<DeleteDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
private deviceApiService:DeviceApiService) {
log("is a device "+(this.data.deviceToDelete instanceof Device)+"
:"+JSON.stringify(this.data.deviceToDelete));
}
result: is a device false : {myObject}
Which not allows to execute my http delete
How can I fix it please?
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.