mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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: https://github.com/angular/angular/pull/45687#discussion_r854499586). PR Close #45949
This commit is contained in:
committed by
Jessica Janiuk
parent
cd04588643
commit
ca04ecedec
@@ -288,6 +288,7 @@ export function ɵɵdefineComponent<T>(componentDefinition: {
|
||||
(typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();
|
||||
|
||||
const type = componentDefinition.type;
|
||||
const standalone = componentDefinition.standalone === true;
|
||||
const declaredInputs: {[key: string]: string} = {} as any;
|
||||
const def: Mutable<ComponentDef<any>, keyof ComponentDef<any>> = {
|
||||
type: type,
|
||||
@@ -309,9 +310,8 @@ export function ɵɵdefineComponent<T>(componentDefinition: {
|
||||
onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,
|
||||
directiveDefs: null!, // assigned in noSideEffects
|
||||
pipeDefs: null!, // assigned in noSideEffects
|
||||
standalone: componentDefinition.standalone === true,
|
||||
dependencies:
|
||||
componentDefinition.standalone === true && componentDefinition.dependencies || null,
|
||||
standalone,
|
||||
dependencies: standalone && componentDefinition.dependencies || null,
|
||||
getStandaloneInjector: null,
|
||||
selectors: componentDefinition.selectors || EMPTY_ARRAY,
|
||||
viewQuery: componentDefinition.viewQuery || null,
|
||||
|
||||
Reference in New Issue
Block a user