MCPcopy Index your code
hub / github.com/angular/angular / createRootLViewEnvironment

Function createRootLViewEnvironment

packages/core/src/render3/component_ref.ts:146–174  ·  view source on GitHub ↗
(rootLViewInjector: Injector)

Source from the content-addressed store, hash-verified

144}
145
146function createRootLViewEnvironment(rootLViewInjector: Injector): LViewEnvironment {
147 const rendererFactory = rootLViewInjector.get(RendererFactory2, null);
148 if (rendererFactory === null) {
149 throw new RuntimeError(
150 RuntimeErrorCode.RENDERER_NOT_FOUND,
151 ngDevMode &&
152 'Angular was not able to inject a renderer (RendererFactory2). ' +
153 'Likely this is due to a broken DI hierarchy. ' +
154 'Make sure that any injector used to create this component has a correct parent.',
155 );
156 }
157
158 const sanitizer = rootLViewInjector.get(Sanitizer, null);
159 const changeDetectionScheduler = rootLViewInjector.get(ChangeDetectionScheduler, null);
160 const tracingService = rootLViewInjector.get(TracingService, null, {optional: true});
161
162 let ngReflect = false;
163 if (typeof ngDevMode === 'undefined' || ngDevMode) {
164 ngReflect = rootLViewInjector.get(NG_REFLECT_ATTRS_FLAG, NG_REFLECT_ATTRS_FLAG_DEFAULT);
165 }
166
167 return {
168 rendererFactory,
169 sanitizer,
170 changeDetectionScheduler,
171 ngReflect,
172 tracingService,
173 };
174}
175
176function createHostElement(componentDef: ComponentDef<unknown>, renderer: Renderer): RElement {
177 // Determine a tag name used for creating host elements when this component is created

Callers 1

createMethod · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…