mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs(core): add API documentation to standalone-related classes (#45687)
This commit adds some internal documentation. PR Close #45687
This commit is contained in:
committed by
Andrew Scott
parent
e162fa3735
commit
9e4c4bc42a
@@ -13,7 +13,11 @@ import {OnDestroy} from '../../interface/lifecycle_hooks';
|
||||
import {ComponentDef} from '../interfaces/definition';
|
||||
import {createEnvironmentInjector} from '../ng_module_ref';
|
||||
|
||||
// TODO(pk): document
|
||||
/**
|
||||
* A service used by the framework to create instances of standalone injectors. Those injectors are
|
||||
* created on demand in case of dynamic component instantiation and contain ambient providers
|
||||
* collected from the imports graph rooted at a given standalone component.
|
||||
*/
|
||||
class StandaloneService implements OnDestroy {
|
||||
cachedInjectors = new Map<ComponentDef<unknown>, EnvironmentInjector|null>();
|
||||
|
||||
@@ -60,7 +64,12 @@ class StandaloneService implements OnDestroy {
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO(pk): documentation
|
||||
* A feature that acts as a setup code for the {@see StandaloneService}.
|
||||
*
|
||||
* The most important responsaibility of this feature is to expose the "getStandaloneInjector"
|
||||
* function (an entry points to a standalone injector creation) on a component definition object. We
|
||||
* go through the features infrastructure to make sure that the standalone injector creation logic
|
||||
* is tree-shakable and not included in applications that don't use standalone components.
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
|
||||
@@ -322,6 +322,9 @@ export interface ComponentDef<T> extends DirectiveDef<T> {
|
||||
*/
|
||||
tView: TView|null;
|
||||
|
||||
/**
|
||||
* A function added by the {@see ɵɵStandaloneFeature} and used by the framework to create standalone injectors.
|
||||
*/
|
||||
getStandaloneInjector: ((parentInjector: EnvironmentInjector) => EnvironmentInjector | null)|null;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user