docs: api doc cleanup (#31377)

PR Close #31377
This commit is contained in:
Judy Bogart
2019-07-01 12:31:42 -07:00
committed by Jason Aden
parent 35f8bfce8b
commit 40aaa42f44
18 changed files with 184 additions and 210 deletions

View File

@ -49,7 +49,7 @@ export abstract class ComponentRef<C> {
abstract get changeDetectorRef(): ChangeDetectorRef;
/**
* The component type.
* The type of this component (as created by a `ComponentFactory` class).
*/
abstract get componentType(): Type<any>;
@ -68,6 +68,12 @@ export abstract class ComponentRef<C> {
}
/**
* Base class for a factory that can create a component dynamically.
* Instantiate a factory for a given type of component with `resolveComponentFactory()`.
* Use the resulting `ComponentFactory.create()` method to create a component of that type.
*
* @see [Dynamic Components](guide/dynamic-component-loader)
*
* @publicApi
*/
export abstract class ComponentFactory<C> {
@ -76,7 +82,7 @@ export abstract class ComponentFactory<C> {
*/
abstract get selector(): string;
/**
* The component's type
* The type of component the factory will create.
*/
abstract get componentType(): Type<any>;
/**

View File

@ -34,10 +34,20 @@ class _NullComponentFactoryResolver implements ComponentFactoryResolver {
}
/**
* A simple registry that maps `Components` to generated `ComponentFactory` classes
* that can be used to create instances of components.
* Use to obtain the factory for a given component type,
* then use the factory's `create()` method to create a component of that type.
*
* @see [Dynamic Components](guide/dynamic-component-loader)
* @publicApi
*/
export abstract class ComponentFactoryResolver {
static NULL: ComponentFactoryResolver = new _NullComponentFactoryResolver();
/**
* Retrieves the factory object that creates a component of the given type.
* @param component The component type.
*/
abstract resolveComponentFactory<T>(component: Type<T>): ComponentFactory<T>;
}