Answers "who creates this component outside a template, with which data,
and where does the result go?": every call or new that hands the
component class to a parameter typed as a component constructor
(Type<T>, ComponentType<T>), e.g. dialog.open(XComponent, config),
new ComponentPortal(XComponent), vcr.createComponent(XComponent) or a
project wrapper such as appDialog.open(XComponent, action, data).
Remarks
No list of known APIs: a creation site is recognised by the resolved
parameter type (a constructor type, bundled aliases like Type$1<C>
included). Project wrappers are followed through their parameter or the
field it is stored in down to the library call (via). Starting from the
references of the component class, the value is followed through
variables, fields, DI tokens ({ provide: T, useValue: X } read with
inject(T) / @Inject(T)), method returns (also through interfaces),
.then callbacks and destructured lazy imports; string literals equal to
the component's selector count when the call returns a component type
(selector registries). Test files are skipped unless includeTestHosts.
The project is only read.
Routes: an object literal property whose contextual type is a component
constructor (component: X) or a function yielding one
(loadComponent: () => import('./x').then(m => m.X)) is a site too;
Route entries carry their path, guards, data and resolve.
Registries: a class listed in an array held by a field or variable
(dynamicComponents = [X, Y], also overriding an abstract base member)
follows the reads of that array (arr[i], for...of, find) out of
the lookup method. Where the value leaves a method call with a string
argument, the argument decides: its literal values
(traceStringLiterals) include the component's selector: certain;
exclude it completely: not a host; otherwise the site is a candidate with
the selector expression, unless an equality guard around the site
(if (sel === 'app-x'), case 'app-x':) fixes the selector.
Finds the dynamic creation sites of a component.
Answers "who creates this component outside a template, with which data, and where does the result go?": every call or
newthat hands the component class to a parameter typed as a component constructor (Type<T>,ComponentType<T>), e.g.dialog.open(XComponent, config),new ComponentPortal(XComponent),vcr.createComponent(XComponent)or a project wrapper such asappDialog.open(XComponent, action, data).Remarks
No list of known APIs: a creation site is recognised by the resolved parameter type (a constructor type, bundled aliases like
Type$1<C>included). Project wrappers are followed through their parameter or the field it is stored in down to the library call (via). Starting from the references of the component class, the value is followed through variables, fields, DI tokens ({ provide: T, useValue: X }read withinject(T)/@Inject(T)), method returns (also through interfaces),.thencallbacks and destructured lazy imports; string literals equal to the component's selector count when the call returns a component type (selector registries). Test files are skipped unlessincludeTestHosts. The project is only read.Routes: an object literal property whose contextual type is a component constructor (
component: X) or a function yielding one (loadComponent: () => import('./x').then(m => m.X)) is a site too;Routeentries carry their path, guards,dataandresolve.Registries: a class listed in an array held by a field or variable (
dynamicComponents = [X, Y], also overriding an abstract base member) follows the reads of that array (arr[i],for...of,find) out of the lookup method. Where the value leaves a method call with a string argument, the argument decides: its literal values (traceStringLiterals) include the component's selector: certain; exclude it completely: not a host; otherwise the site is a candidate with the selector expression, unless an equality guard around the site (if (sel === 'app-x'),case 'app-x':) fixes the selector.The result of a site is followed further by DynamicResultFollower.
Example