Home Manual Reference Source Repository
import {ViewFactory} from 'ug-layout/view/ViewFactory'
public class | source

ViewFactory

Responsible for creating view containers from view configurations.

Constructor Summary

Public Constructor
public

constructor(_injector: *)

Method Summary

Public Methods
public

create(args: ViewFactoryArgs): ViewContainer<T>

Creates a view container from the given configuration.

public
public

getTokenFrom(config: ViewConfig): *

Gets the token from a view config.

public

resolveConfigProperty(config: ViewConfig, path: string): T | null

Resolves a config property by looking at the view config then the components metadata config.

public

resolveMetaConfigProperty(token: *, path: string): T | null

Resolves a config property from the tokens metadata.

Public Constructors

public constructor(_injector: *) source

Params:

NameTypeAttributeDescription
_injector *

Public Methods

public create(args: ViewFactoryArgs): ViewContainer<T> source

Creates a view container from the given configuration.

Params:

NameTypeAttributeDescription
args ViewFactoryArgs

Return:

ViewContainer<T>

public destroy() source

public getTokenFrom(config: ViewConfig): * source

Gets the token from a view config. If using useClass the class will be used as the token. Any other type will require token to be provided.

Params:

NameTypeAttributeDescription
config ViewConfig

Return:

*

public resolveConfigProperty(config: ViewConfig, path: string): T | null source

Resolves a config property by looking at the view config then the components metadata config.

Params:

NameTypeAttributeDescription
config ViewConfig
path string

Return:

T | null

public resolveMetaConfigProperty(token: *, path: string): T | null source

Resolves a config property from the tokens metadata.

Params:

NameTypeAttributeDescription
token *
path string

Return:

T | null