File

projects/ui-kit-lib/src/lib/v2/toastr/portal/portal.ts

Description

A ComponentPortal is a portal that instantiates some Component upon attachment.

Index

Properties
Methods
Accessors

Constructor

constructor(component: ComponentType<T>, injector: Injector)
Parameters :
Name Type Optional
component ComponentType<T> No
injector Injector No

Properties

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.

Methods

attach
attach(host: BasePortalHost, newestOnTop: boolean)

Attach this portal to a host.

Parameters :
Name Type Optional
host BasePortalHost No
newestOnTop boolean No
Returns : ComponentRef<unknown>
detach
detach()

Detach this portal from its host

Returns : void
setAttachedHost
setAttachedHost(host?: BasePortalHost)

Sets the PortalHost reference without performing attach(). This is used directly by the PortalHost when it is performing an attach() or detach().

Parameters :
Name Type Optional
host BasePortalHost Yes
Returns : void

Accessors

isAttached
getisAttached()

Whether this portal is attached to a host.

Returns : boolean

results matching ""

    No results matching ""