projects/ui-kit-lib/src/lib/v2/toastr/portal/portal.ts
A ComponentPortal is a portal that instantiates some Component upon attachment.
Properties |
Methods |
Accessors |
constructor(component: ComponentType<T>, injector: Injector)
|
|||||||||
|
Parameters :
|
| component |
Type : ComponentType<T>
|
|
The type of the component that will be instantiated for attachment. |
| injector |
Type : Injector
|
|
Injector used for the instantiation of the component. |
| viewContainerRef |
Type : ViewContainerRef
|
|
[Optional] Where the attached component should live in Angular's logical component tree. This is different from where the component renders, which is determined by the PortalHost. The origin necessary when the host is outside of the Angular application context. |
| attach | |||||||||
attach(host: BasePortalHost, newestOnTop: boolean)
|
|||||||||
|
Attach this portal to a host.
Parameters :
Returns :
ComponentRef<unknown>
|
| detach |
detach()
|
|
Detach this portal from its host
Returns :
void
|
| setAttachedHost | ||||||
setAttachedHost(host?: BasePortalHost)
|
||||||
|
Sets the PortalHost reference without performing
Parameters :
Returns :
void
|
| isAttached |
getisAttached()
|
|
Whether this portal is attached to a host.
Returns :
boolean
|