@@ -21,15 +21,13 @@ import {
2121 ComponentFactory as AbstractComponentFactory ,
2222 ComponentRef as AbstractComponentRef ,
2323} from '../linker/component_factory' ;
24- import { ComponentFactoryResolver as AbstractComponentFactoryResolver } from '../linker/component_factory_resolver' ;
2524import { createElementRef , ElementRef } from '../linker/element_ref' ;
2625import { NgModuleRef } from '../linker/ng_module_factory' ;
2726import { RendererFactory2 } from '../render/api' ;
2827import { Sanitizer } from '../sanitization/sanitizer' ;
2928
30- import { assertComponentType } from './assert' ;
3129import { attachPatchData } from './context_discovery' ;
32- import { getComponentDef , getDirectiveDef , getDirectiveDefOrThrow } from './def_getters' ;
30+ import { getDirectiveDef , getDirectiveDefOrThrow } from './def_getters' ;
3331import { depsTracker } from './deps_tracker/deps_tracker' ;
3432import { NodeInjector } from './di' ;
3533import { reportUnknownPropertyError } from './instructions/element_validation' ;
@@ -62,50 +60,35 @@ import {
6260} from './interfaces/view' ;
6361import { MATH_ML_NAMESPACE , SVG_NAMESPACE } from './namespaces' ;
6462
63+ import { ProfilerEvent } from '../../primitives/devtools' ;
64+ import { TracingService } from '../application/tracing' ;
65+ import { DOCUMENT } from '../document' ;
6566import { retrieveHydrationInfo } from '../hydration/utils' ;
67+ import { getComponentName } from '../internal/get_closest_component_name' ;
68+ import { NG_REFLECT_ATTRS_FLAG , NG_REFLECT_ATTRS_FLAG_DEFAULT } from '../ng_reflect' ;
6669import { ChainedInjector } from './chained_injector' ;
6770import { createElementNode , setupStaticAttributes } from './dom_node_manipulation' ;
71+ import { BINDING , Binding , BindingInternal , DirectiveWithBindings } from './dynamic_bindings' ;
72+ import { getDocument } from './interfaces/document' ;
6873import { unregisterLView } from './interfaces/lview_tracking' ;
6974import { Renderer } from './interfaces/renderer' ;
75+ import { SHARED_STYLES_HOST } from './interfaces/shared_styles_host' ;
7076import {
7177 extractAttrsAndClassesFromSelector ,
7278 stringifyCSSSelectorList ,
7379} from './node_selector_matcher' ;
7480import { profiler } from './profiler' ;
75- import { ProfilerEvent } from '../../primitives/devtools' ;
7681import { executeContentQueries } from './queries/query_execution' ;
7782import { enterView , leaveView } from './state' ;
7883import { debugStringifyTypeForError , stringifyForError } from './util/stringify_utils' ;
7984import { getComponentLViewByIndex , getTNode , storeLViewOnDestroy } from './util/view_utils' ;
85+ import { createLView , createTView , getInitialLViewFlagsFromDef } from './view/construction' ;
8086import { directiveHostEndFirstCreatePass , directiveHostFirstCreatePass } from './view/elements' ;
8187import { ViewRef } from './view_ref' ;
82- import { createLView , createTView , getInitialLViewFlagsFromDef } from './view/construction' ;
83- import { BINDING , Binding , BindingInternal , DirectiveWithBindings } from './dynamic_bindings' ;
84- import { NG_REFLECT_ATTRS_FLAG , NG_REFLECT_ATTRS_FLAG_DEFAULT } from '../ng_reflect' ;
85- import { TracingService } from '../application/tracing' ;
86- import { getComponentName } from '../internal/get_closest_component_name' ;
87- import { SHARED_STYLES_HOST } from './interfaces/shared_styles_host' ;
88- import { DOCUMENT } from '../document' ;
89- import { getDocument } from './interfaces/document' ;
9088
9189const shadowRootSupported = typeof ShadowRoot !== 'undefined' ;
9290const documentSupported = typeof Document !== 'undefined' ;
9391
94- export class ComponentFactoryResolver extends AbstractComponentFactoryResolver {
95- /**
96- * @param ngModule The NgModuleRef to which all resolved factories are bound.
97- */
98- constructor ( private ngModule ?: NgModuleRef < any > ) {
99- super ( ) ;
100- }
101-
102- override resolveComponentFactory < T > ( component : Type < T > ) : AbstractComponentFactory < T > {
103- ngDevMode && assertComponentType ( component ) ;
104- const componentDef = getComponentDef ( component ) ! ;
105- return new ComponentFactory ( componentDef , this . ngModule ) ;
106- }
107- }
108-
10992function toInputRefArray < T > ( map : DirectiveDef < T > [ 'inputs' ] ) : ComponentFactory < T > [ 'inputs' ] {
11093 return Object . keys ( map ) . map ( ( name ) => {
11194 const [ propName , flags , transform ] = map [ name ] ;
0 commit comments