ViewContainer
A container that holds a 1 to 1 relationship with a component instance. This instance is the main API for a component to interact with the layout framework.
Constructor Summary
Public Constructor | ||
public |
constructor(_document: Document, _injector: Injector) Creates an instance of ViewContainer. |
Member Summary
Public Members | ||
public |
Notifies when the view has become attached. |
|
public |
Notifies that the view is being destroyed. |
|
public get |
The component instance associated with this container. |
|
public |
Notifies when the component is initialized. |
|
public |
Notifies when the component is assigned to the container and ready for access. |
|
public |
containerChange: Observable<View | null> Notifies when this container has changed the View it is associated with. |
|
public |
Notifies when the view is destroyed. |
|
public |
Notifies when the view has become detached. |
|
public get |
The HTML element for this container. |
|
public get |
hasComponent: * |
|
public get |
Current height in pixels. |
|
public |
A unique identifier for this instance. |
|
public |
Contains the state of ths views initialized state. |
|
public get |
Whether the container is cacheable. |
|
public get |
isLazy: * |
|
public |
sizeChanges: Observable<{width: number, height: number}>{width:> Notifies when the dimensions of this views container has changed. |
|
public |
status: Observable<ViewContainerStatus> Notifies when the status of this component changes. |
|
public get |
view: * |
|
public |
Notifies when the visibility of this view changes. |
|
public get |
Current width in pixels. |
Method Summary
Public Methods | ||
public |
Closes this view. |
|
public |
destroy() Destroys the container. |
|
public |
detach() Detaches this container from it's view. |
|
public |
fail(retry: *) |
|
public |
Get's a token from this containers injector. Note, this should not be used to grab parent renderables or any item that can be changed. |
|
public |
Gets this renderables parent or any parent that is an instance of the passed in constructor. |
|
public |
getParents(Ctor: Type<T>): T | null Gets this renderables parents or any parents that are an instance of the passed in constructor. |
|
public |
Initializes the component. |
|
public |
Determines whether this renderable is visible. |
|
public |
Signals up the tree to make this View visible. |
|
public |
mount(element: HTMLElement) Mounts an element to this containers element. |
|
public |
Sets all the content of this containers element to the given HTML string. |
|
public |
mountTo(element: HTMLElement) Mounts this containers element to the given element. |
|
public |
ready(options: {init?: boolean}): Promise<ViewContainer<T>> Waits for the component to be ready. |
|
public |
resolve(options: {}): * |
|
public |
retry() |
|
public |
Sets the containing View for this container. |
Public Constructors
Public Members
public beforeDestroy: Observable<BeforeDestroyEvent<Renderable>> source
Notifies that the view is being destroyed. This action is cancellable or can be halted until an async action is complete.
See:
public componentReady: Observable<boolean> source
Notifies when the component is assigned to the container and ready for access.
public containerChange: Observable<View | null> source
Notifies when this container has changed the View it is associated with.
public get hasComponent: * source
public get isLazy: * source
public sizeChanges: Observable<{width: number, height: number}>{width:> source
Notifies when the dimensions of this views container has changed.
public status: Observable<ViewContainerStatus> source
Notifies when the status of this component changes.
public get view: * source
public visibilityChanges: Observable<boolean> source
Notifies when the visibility of this view changes.
Public Methods
public close(args: {silent?: boolean}) source
Closes this view.
Params:
Name | Type | Attribute | Description |
args | {silent?: boolean} |
public fail(retry: *) source
Params:
Name | Type | Attribute | Description |
retry | * |
public get(token: *): U | null source
Get's a token from this containers injector. Note, this should not be used to grab parent renderables or any item that can be changed.
Params:
Name | Type | Attribute | Description |
token | * |
public getParent(Ctor: Type<T>): T | null source
Gets this renderables parent or any parent that is an instance of the passed in constructor. If non is found then null is returned.
Params:
Name | Type | Attribute | Description |
Ctor | Type<T> |
|
public getParents(Ctor: Type<T>): T | null source
Gets this renderables parents or any parents that are an instance of the passed in constructor.
Params:
Name | Type | Attribute | Description |
Ctor | Type<T> |
|
public mount(element: HTMLElement) source
Mounts an element to this containers element.
Params:
Name | Type | Attribute | Description |
element | HTMLElement |
public mountHTML(html: string) source
Sets all the content of this containers element to the given HTML string.
Params:
Name | Type | Attribute | Description |
html | string |
public mountTo(element: HTMLElement) source
Mounts this containers element to the given element.
Params:
Name | Type | Attribute | Description |
element | HTMLElement |
public ready(options: {init?: boolean}): Promise<ViewContainer<T>> source
Waits for the component to be ready. If the component is not initialized it will be initialized. This is important when the view is lazy and hasn't been shown yet but we need to interact with the component.
Params:
Name | Type | Attribute | Description |
options | {init?: boolean} |
|
public resolve(options: {}): * source
Params:
Name | Type | Attribute | Description |
options | {} |
|
Return:
* |