PopupService is an Angular service which provides API calls that are used to create Popup instances dynamically.
That is, the service helps create Popup instances from TypeScript based on user interactions and without the need to define the component in a template.
The service allows you to configure different Popup settings. All possible options are defined by the
The following example demonstrates how to set an absolute position for the Popup.
You can render the content of the Popup by:
The Popup allows the use of template expressions in its content area. To enable this behavior, pass a
The Popup also allows the rendering of component types in its content area. To enable this behavior, pass a reference to the dynamically created component in the
content field of the result.
Verify that all dynamically created components are registered as
NgModuleof the application. If the components are not registered, Angular throws a runtime error that there is no component factory for the component.
By default, the Popup gets inserted into the first root component which is available in the
ApplicationRef class. To change this behavior, use the
appendTo option which specifies a