File

src/app/dynamic-components.ts

Description

This registry hold all the loading functions for components that can be used dynamically with lazy loading.

Extends

Registry

Index

Methods

Methods

Public add
add(key: string, mapping: T)
Inherited from Registry
Defined in Registry:17
Parameters :
Name Type Optional
key string No
mapping T No
Returns : void
Public addAll
addAll(tuples: [])
Inherited from Registry
Defined in Registry:31
Parameters :
Name Type Optional
tuples [] No
Returns : void
Public allowDuplicates
allowDuplicates()
Inherited from Registry
Defined in Registry:49

Calling this will allow the same keys to be added multiple times without thrown errors. This is useful for storybook where live-updates re-trigger the decorator while the registry is cached.

Returns : void
Public get
get(key: string)
Inherited from Registry
Defined in Registry:35
Parameters :
Name Type Optional
key string No
Returns : T
import { Type } from "@angular/core";
import { Registry } from "./core/config/registry/dynamic-registry";

export type AsyncComponent = () => Promise<Type<any>>;

/**
 * This registry hold all the loading functions for components that can be used dynamically with lazy loading.
 */
export class ComponentRegistry extends Registry<AsyncComponent> {}

// TODO make a build script that looks for annotations and creates this
export const componentRegistry = new ComponentRegistry();

export type ComponentTuple = [string, AsyncComponent];

results matching ""

    No results matching ""