I want to load a modal from a component. In Angular Material documentation is write to add the modal component in entryComponents :
This :
@NgModule
An alternative would be to use TemplateRef. This is especially useful in the case of the Angular Material dialog example above, which support both ComponentType and TemplateRef.
In the HTML, you can use @Input to pass your data to the component
The TS is very simple and there is no need to worry about the module to be lazy loaded or to use entryComponent.
@ViewChild("popup") popupRef: TemplateRef;
public handleClick() {
this.modalService.open(this.popupRef, options);
}