Skip to content

Commit ca04ece

Browse files
AndrewKushnirthePunderWoman
authored andcommitted
refactor(core): avoid code duplication in standalone-related logic (#45949)
This commit updates the standalone-related logic to address the feedback from previous code reviews (specifically: #45687 (comment)). PR Close #45949
1 parent cd04588 commit ca04ece

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/core/src/render3/definition.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ export function ɵɵdefineComponent<T>(componentDefinition: {
288288
(typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();
289289

290290
const type = componentDefinition.type;
291+
const standalone = componentDefinition.standalone === true;
291292
const declaredInputs: {[key: string]: string} = {} as any;
292293
const def: Mutable<ComponentDef<any>, keyof ComponentDef<any>> = {
293294
type: type,
@@ -309,9 +310,8 @@ export function ɵɵdefineComponent<T>(componentDefinition: {
309310
onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,
310311
directiveDefs: null!, // assigned in noSideEffects
311312
pipeDefs: null!, // assigned in noSideEffects
312-
standalone: componentDefinition.standalone === true,
313-
dependencies:
314-
componentDefinition.standalone === true && componentDefinition.dependencies || null,
313+
standalone,
314+
dependencies: standalone && componentDefinition.dependencies || null,
315315
getStandaloneInjector: null,
316316
selectors: componentDefinition.selectors || EMPTY_ARRAY,
317317
viewQuery: componentDefinition.viewQuery || null,

0 commit comments

Comments
 (0)