@NgModule.entryComponents and Components created dynamically
问题 I am opening a Modal in two different ways Stackblitz Example: Calling a method in a component which calls the Modal Service: <button (click)="openModal()">Open Modal</button> export class AppComponent { constructor(private modalService: ModalService) { } openModal() { this.modalService.open(HelloComponent); } } The Modal service creates the component dynamically. Using a directive that then calls the ModalService: <button [modal]="'HelloComponent'">Open Modal</button> @Directive({ selector: