diff --git a/components/affix/affix.component.ts b/components/affix/affix.component.ts index 64222d5c4e6..8adffafa373 100644 --- a/components/affix/affix.component.ts +++ b/components/affix/affix.component.ts @@ -62,11 +62,11 @@ export class NzAffixComponent implements AfterViewInit, OnChanges, OnDestroy, On @Input() nzTarget?: string | Element | Window; @Input({ transform: numberAttributeWithZeroFallback }) - @WithConfig() + @WithConfig() nzOffsetTop?: null | number; @Input({ transform: numberAttributeWithZeroFallback }) - @WithConfig() + @WithConfig() nzOffsetBottom?: null | number; @Output() readonly nzChange = new EventEmitter(); diff --git a/components/anchor/anchor.component.ts b/components/anchor/anchor.component.ts index 11fbbfba6b3..b683eb946ad 100644 --- a/components/anchor/anchor.component.ts +++ b/components/anchor/anchor.component.ts @@ -97,11 +97,11 @@ export class NzAnchorComponent implements OnDestroy, AfterViewInit, OnChanges { nzBounds: number = 5; @Input({ transform: numberAttributeWithZeroFallback }) - @WithConfig() + @WithConfig() nzOffsetTop?: number = undefined; @Input({ transform: numberAttributeWithZeroFallback }) - @WithConfig() + @WithConfig() nzTargetOffset?: number = undefined; @Input() nzContainer?: string | HTMLElement; diff --git a/components/breadcrumb/breadcrumb.component.ts b/components/breadcrumb/breadcrumb.component.ts index 448aef30e85..5c1e9e47d99 100644 --- a/components/breadcrumb/breadcrumb.component.ts +++ b/components/breadcrumb/breadcrumb.component.ts @@ -16,7 +16,8 @@ import { Renderer2, TemplateRef, ViewEncapsulation, - booleanAttribute + booleanAttribute, + forwardRef } from '@angular/core'; import { ActivatedRoute, NavigationEnd, PRIMARY_OUTLET, Params, Router } from '@angular/router'; import { Subject } from 'rxjs'; @@ -39,7 +40,7 @@ export interface BreadcrumbOption { selector: 'nz-breadcrumb', exportAs: 'nzBreadcrumb', preserveWhitespaces: false, - providers: [{ provide: NzBreadcrumb, useExisting: NzBreadCrumbComponent }], + providers: [{ provide: NzBreadcrumb, useExisting: forwardRef(() => NzBreadCrumbComponent) }], standalone: true, imports: [NzBreadCrumbItemComponent], template: ` diff --git a/components/core/config/config.service.ts b/components/core/config/config.service.ts index 15514300cf5..47ce184976c 100644 --- a/components/core/config/config.service.ts +++ b/components/core/config/config.service.ts @@ -5,7 +5,7 @@ import { CSP_NONCE, Injectable, inject } from '@angular/core'; import { Observable, Subject } from 'rxjs'; -import { filter, mapTo } from 'rxjs/operators'; +import { filter, map } from 'rxjs/operators'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; @@ -47,7 +47,7 @@ export class NzConfigService { getConfigChangeEventForComponent(componentName: NzConfigKey): Observable { return this.configUpdated$.pipe( filter(n => n === componentName), - mapTo(undefined) + map(() => undefined) ); } @@ -60,51 +60,51 @@ export class NzConfigService { } } -/* eslint-disable no-invalid-this */ - /** - * This decorator is used to decorate properties. If a property is decorated, it would try to load default value from - * config. + * This decorator is used to decorate class field. If a class field is decorated and unassigned, it would try to load default value from `NZ_CONFIG` + * + * @note that the class must have `_nzModuleName`({@link NzConfigKey}) property. + * @example + * ```ts + * class ExampleComponent { + * private readonly _nzModuleName: NzConfigKey = 'button'; + * @WithConfig() size: string = 'default'; + * } + * ``` */ -// eslint-disable-next-line -export function WithConfig() { - return function ConfigDecorator( - target: NzSafeAny, - propName: NzSafeAny, - originalDescriptor?: TypedPropertyDescriptor - ): NzSafeAny { - const privatePropName = `$$__zorroConfigDecorator__${propName}`; - - Object.defineProperty(target, privatePropName, { - configurable: true, - writable: true, - enumerable: false - }); +export function WithConfig() { + return function (_value: undefined, context: ClassFieldDecoratorContext) { + context.addInitializer(function () { + const nzConfigService = inject(NzConfigService); + const originalValue = this[context.name as keyof This]; + + let value: Value; + let assignedByUser = false; + + Object.defineProperty(this, context.name, { + get: () => { + const configValue = nzConfigService.getConfigForComponent( + this['_nzModuleName' as keyof This] as NzConfigKey + )?.[context.name as keyof NzConfig[NzConfigKey]]; + + if (assignedByUser) { + return value; + } + + if (isDefined(configValue)) { + return configValue; + } - return { - get(): T | undefined { - const originalValue = originalDescriptor?.get ? originalDescriptor.get.bind(this)() : this[privatePropName]; - const assignedByUser = (this.propertyAssignCounter?.[propName] || 0) > 1; - const configValue = this.nzConfigService.getConfigForComponent(this._nzModuleName)?.[propName]; - if (assignedByUser && isDefined(originalValue)) { return originalValue; - } else { - return isDefined(configValue) ? configValue : originalValue; - } - }, - set(value?: T): void { - // If the value is assigned, we consider the newly assigned value as 'assigned by user'. - this.propertyAssignCounter = this.propertyAssignCounter || {}; - this.propertyAssignCounter[propName] = (this.propertyAssignCounter[propName] || 0) + 1; - - if (originalDescriptor?.set) { - originalDescriptor.set.bind(this)(value!); - } else { - this[privatePropName] = value; - } - }, - configurable: true, - enumerable: true - }; + }, + set: (newValue: Value) => { + // if the newValue is undefined, we also consider it as not assigned by user + assignedByUser = isDefined(newValue); + value = newValue; + }, + enumerable: true, + configurable: true + }); + }); }; } diff --git a/components/dropdown/dropdown.directive.ts b/components/dropdown/dropdown.directive.ts index fddb13d6c2f..d2540561edd 100644 --- a/components/dropdown/dropdown.directive.ts +++ b/components/dropdown/dropdown.directive.ts @@ -64,7 +64,7 @@ export class NzDropDownDirective implements AfterViewInit, OnDestroy, OnChanges @Input() nzDropdownMenu: NzDropdownMenuComponent | null = null; @Input() nzTrigger: 'click' | 'hover' = 'hover'; @Input() nzMatchWidthElement: ElementRef | null = null; - @Input({ transform: booleanAttribute }) @WithConfig() nzBackdrop = false; + @Input({ transform: booleanAttribute }) @WithConfig() nzBackdrop = false; @Input({ transform: booleanAttribute }) nzClickHide = true; @Input({ transform: booleanAttribute }) nzDisabled = false; @Input({ transform: booleanAttribute }) nzVisible = false; diff --git a/components/float-button/float-button-top.component.ts b/components/float-button/float-button-top.component.ts index 18561ee1ab9..23c31c4a8c7 100644 --- a/components/float-button/float-button-top.component.ts +++ b/components/float-button/float-button-top.component.ts @@ -12,13 +12,13 @@ import { Component, ElementRef, EventEmitter, - Inject, + inject, Input, NgZone, + numberAttribute, OnChanges, OnDestroy, OnInit, - Optional, Output, SimpleChanges, TemplateRef, @@ -31,8 +31,6 @@ import { debounceTime, takeUntil } from 'rxjs/operators'; import { fadeMotion } from 'ng-zorro-antd/core/animation'; import { NzConfigKey, NzConfigService, WithConfig } from 'ng-zorro-antd/core/config'; import { NzDestroyService, NzScrollService } from 'ng-zorro-antd/core/services'; -import { NumberInput, NzSafeAny } from 'ng-zorro-antd/core/types'; -import { InputNumber } from 'ng-zorro-antd/core/util'; import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzFloatButtonComponent } from './float-button.component'; @@ -75,11 +73,9 @@ const passiveEventListenerOptions = normalizePassiveListenerOptions({ passive: t }) export class NzFloatButtonTopComponent implements OnInit, OnDestroy, OnChanges { readonly _nzModuleName: NzConfigKey = NZ_CONFIG_MODULE_NAME; - static ngAcceptInputType_nzVisibilityHeight: NumberInput; - static ngAcceptInputType_nzDuration: NumberInput; private scrollListenerDestroy$ = new Subject(); - private target: HTMLElement | null = null; + private target?: HTMLElement | null = null; visible: boolean = false; dir: Direction = 'ltr'; @@ -91,9 +87,9 @@ export class NzFloatButtonTopComponent implements OnInit, OnDestroy, OnChanges { @Input() nzDescription: TemplateRef | null = null; @Input() nzTemplate?: TemplateRef; - @Input() @WithConfig() @InputNumber() nzVisibilityHeight: number = 400; + @Input({ transform: numberAttribute }) @WithConfig() nzVisibilityHeight: number = 400; @Input() nzTarget?: string | HTMLElement; - @Input() @InputNumber() nzDuration: number = 450; + @Input({ transform: numberAttribute }) nzDuration: number = 450; @Output() readonly nzOnClick: EventEmitter = new EventEmitter(); @ViewChild('backTop', { static: false }) @@ -114,10 +110,10 @@ export class NzFloatButtonTopComponent implements OnInit, OnDestroy, OnChanges { } } + private doc = inject(DOCUMENT); private backTopClickSubscription = Subscription.EMPTY; constructor( - @Inject(DOCUMENT) private doc: NzSafeAny, public nzConfigService: NzConfigService, private scrollSrv: NzScrollService, private platform: Platform, @@ -125,7 +121,7 @@ export class NzFloatButtonTopComponent implements OnInit, OnDestroy, OnChanges { private zone: NgZone, private cdr: ChangeDetectorRef, private destroy$: NzDestroyService, - @Optional() private directionality: Directionality + private directionality: Directionality ) { this.dir = this.directionality.value; } diff --git a/components/graph/graph.component.ts b/components/graph/graph.component.ts index 09c5e24ffa7..ec98fb157f1 100644 --- a/components/graph/graph.component.ts +++ b/components/graph/graph.component.ts @@ -23,6 +23,7 @@ import { ViewChildren, ViewEncapsulation, booleanAttribute, + forwardRef, inject } from '@angular/core'; import { Observable, ReplaySubject, Subject, Subscription, forkJoin } from 'rxjs'; @@ -72,7 +73,7 @@ export function isDataSource(value: NzSafeAny): value is NzGraphData { encapsulation: ViewEncapsulation.None, selector: 'nz-graph', exportAs: 'nzGraph', - providers: [{ provide: NzGraph, useExisting: NzGraphComponent }], + providers: [{ provide: NzGraph, useExisting: forwardRef(() => NzGraphComponent) }], template: ` diff --git a/components/image/image-preview.component.ts b/components/image/image-preview.component.ts index 5d7d86aaa74..0beee91582e 100644 --- a/components/image/image-preview.component.ts +++ b/components/image/image-preview.component.ts @@ -13,7 +13,7 @@ import { Component, ElementRef, EventEmitter, - Inject, + inject, NgZone, OnInit, ViewChild, @@ -230,6 +230,7 @@ export class NzImagePreviewComponent implements OnInit { @ViewChild('imgRef') imageRef!: ElementRef; @ViewChild('imagePreviewWrapper', { static: true }) imagePreviewWrapper!: ElementRef; + private document = inject(DOCUMENT); private zoom: number; private rotate: number; private scaleStep: number; @@ -251,8 +252,7 @@ export class NzImagePreviewComponent implements OnInit { public nzConfigService: NzConfigService, public config: NzImagePreviewOptions, private destroy$: NzDestroyService, - private sanitizer: DomSanitizer, - @Inject(DOCUMENT) private document: Document + private sanitizer: DomSanitizer ) { this.zoom = this.config.nzZoom ?? this._defaultNzZoom; this.scaleStep = this.config.nzScaleStep ?? this._defaultNzScaleStep; diff --git a/components/select/select.component.ts b/components/select/select.component.ts index ff5523ca6e0..bdcbff26c85 100644 --- a/components/select/select.component.ts +++ b/components/select/select.component.ts @@ -224,7 +224,7 @@ export class NzSelectComponent implements ControlValueAccessor, OnInit, AfterCon @Input() nzId: string | null = null; @Input() nzSize: NzSelectSizeType = 'default'; @Input() nzStatus: NzStatus = ''; - @Input() @WithConfig() nzOptionHeightPx = 32; + @Input() @WithConfig() nzOptionHeightPx = 32; @Input() nzOptionOverflowSize = 8; @Input() nzDropdownClassName: string[] | string | null = null; @Input() nzDropdownMatchSelectWidth = true; @@ -236,7 +236,7 @@ export class NzSelectComponent implements ControlValueAccessor, OnInit, AfterCon @Input() nzDropdownRender: TemplateRef | null = null; @Input() nzCustomTemplate: TemplateRef<{ $implicit: NzSelectItemInterface }> | null = null; @Input() - @WithConfig | string | null>() + @WithConfig() nzSuffixIcon: TemplateRef | string | null = null; @Input() nzClearIcon: TemplateRef | null = null; @Input() nzRemoveIcon: TemplateRef | null = null; @@ -248,7 +248,7 @@ export class NzSelectComponent implements ControlValueAccessor, OnInit, AfterCon @Input() nzFilterOption: NzFilterOptionType = defaultFilterOption; @Input() compareWith: (o1: NzSafeAny, o2: NzSafeAny) => boolean = (o1: NzSafeAny, o2: NzSafeAny) => o1 === o2; @Input({ transform: booleanAttribute }) nzAllowClear = false; - @Input({ transform: booleanAttribute }) @WithConfig() nzBorderless = false; + @Input({ transform: booleanAttribute }) @WithConfig() nzBorderless = false; @Input({ transform: booleanAttribute }) nzShowSearch = false; @Input({ transform: booleanAttribute }) nzLoading = false; @Input({ transform: booleanAttribute }) nzAutoFocus = false; @@ -257,7 +257,7 @@ export class NzSelectComponent implements ControlValueAccessor, OnInit, AfterCon @Input({ transform: booleanAttribute }) nzDisabled = false; @Input({ transform: booleanAttribute }) nzOpen = false; @Input({ transform: booleanAttribute }) nzSelectOnTab = false; - @Input({ transform: booleanAttribute }) @WithConfig() nzBackdrop = false; + @Input({ transform: booleanAttribute }) @WithConfig() nzBackdrop = false; @Input() nzOptions: NzSelectOptionInterface[] = []; @Input({ transform: booleanAttribute }) diff --git a/components/table/src/addon/filter-trigger.component.ts b/components/table/src/addon/filter-trigger.component.ts index 061e2de683c..166c48548b9 100644 --- a/components/table/src/addon/filter-trigger.component.ts +++ b/components/table/src/addon/filter-trigger.component.ts @@ -60,7 +60,7 @@ export class NzFilterTriggerComponent implements OnInit { @Input() nzDropdownMenu!: NzDropdownMenuComponent; @Input() nzVisible = false; - @Input({ transform: booleanAttribute }) @WithConfig() nzBackdrop = false; + @Input({ transform: booleanAttribute }) @WithConfig() nzBackdrop = false; @Output() readonly nzVisibleChange = new EventEmitter(); diff --git a/components/tabs/tabset.component.ts b/components/tabs/tabset.component.ts index 4513100cd5e..23232d62226 100644 --- a/components/tabs/tabset.component.ts +++ b/components/tabs/tabset.component.ts @@ -18,6 +18,7 @@ import { Component, ContentChildren, EventEmitter, + forwardRef, inject, Input, NgZone, @@ -67,7 +68,7 @@ let nextId = 0; providers: [ { provide: NZ_TAB_SET, - useExisting: NzTabSetComponent + useExisting: forwardRef(() => NzTabSetComponent) } ], template: ` diff --git a/components/time-picker/time-picker-panel.component.ts b/components/time-picker/time-picker-panel.component.ts index 34924d10871..c42fae464ef 100644 --- a/components/time-picker/time-picker-panel.component.ts +++ b/components/time-picker/time-picker-panel.component.ts @@ -22,6 +22,7 @@ import { ViewChild, ViewEncapsulation, booleanAttribute, + forwardRef, numberAttribute } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; @@ -146,7 +147,7 @@ export type NzTimePickerUnit = 'hour' | 'minute' | 'second' | '12-hour'; '[class.ant-picker-time-panel-narrow]': `enabledColumns < 3`, '[class.ant-picker-time-panel-placement-bottomLeft]': `!nzInDatePicker` }, - providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: NzTimePickerPanelComponent, multi: true }], + providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NzTimePickerPanelComponent), multi: true }], imports: [DecimalPipe, NgTemplateOutlet, NzI18nModule, NzButtonModule], standalone: true }) diff --git a/components/time-picker/time-picker.component.ts b/components/time-picker/time-picker.component.ts index 58f5124f28b..cda6fc78a5a 100644 --- a/components/time-picker/time-picker.component.ts +++ b/components/time-picker/time-picker.component.ts @@ -25,6 +25,7 @@ import { ViewChild, ViewEncapsulation, booleanAttribute, + forwardRef, inject } from '@angular/core'; import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms'; @@ -144,7 +145,7 @@ const NZ_CONFIG_MODULE_NAME: NzConfigKey = 'timePicker'; '(click)': 'open()' }, animations: [slideMotion], - providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: NzTimePickerComponent, multi: true }], + providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NzTimePickerComponent), multi: true }], imports: [ AsyncPipe, FormsModule, diff --git a/components/tree-view/node.ts b/components/tree-view/node.ts index 0003f02b6b2..61a1a1f2d1d 100644 --- a/components/tree-view/node.ts +++ b/components/tree-view/node.ts @@ -11,6 +11,7 @@ import { Directive, ElementRef, EmbeddedViewRef, + forwardRef, Input, OnChanges, OnDestroy, @@ -39,8 +40,8 @@ export interface NzTreeVirtualNodeData { exportAs: 'nzTreeNode', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ - { provide: CdkTreeNode, useExisting: NzTreeNodeComponent }, - { provide: NzNodeBase, useExisting: NzTreeNodeComponent } + { provide: CdkTreeNode, useExisting: forwardRef(() => NzTreeNodeComponent) }, + { provide: NzNodeBase, useExisting: forwardRef(() => NzTreeNodeComponent) } ], template: ` @if (indents.length) { @@ -127,7 +128,7 @@ export class NzTreeNodeComponent extends NzNodeBase implements OnDestroy, @Directive({ selector: '[nzTreeNodeDef]', - providers: [{ provide: CdkTreeNodeDef, useExisting: NzTreeNodeDefDirective }], + providers: [{ provide: CdkTreeNodeDef, useExisting: forwardRef(() => NzTreeNodeDefDirective) }], standalone: true }) export class NzTreeNodeDefDirective extends CdkTreeNodeDef { diff --git a/components/tree-view/outlet.ts b/components/tree-view/outlet.ts index 2ee998261f7..8b898f0ba37 100644 --- a/components/tree-view/outlet.ts +++ b/components/tree-view/outlet.ts @@ -4,14 +4,14 @@ */ import { CDK_TREE_NODE_OUTLET_NODE, CdkTreeNodeOutlet } from '@angular/cdk/tree'; -import { Directive, ViewContainerRef, inject } from '@angular/core'; +import { Directive, ViewContainerRef, forwardRef, inject } from '@angular/core'; @Directive({ selector: '[nzTreeNodeOutlet]', providers: [ { provide: CdkTreeNodeOutlet, - useExisting: NzTreeNodeOutletDirective + useExisting: forwardRef(() => NzTreeNodeOutletDirective) } ], standalone: true diff --git a/components/tree-view/padding.ts b/components/tree-view/padding.ts index e76f0a53067..5f100ec7883 100644 --- a/components/tree-view/padding.ts +++ b/components/tree-view/padding.ts @@ -4,11 +4,11 @@ */ import { CdkTreeNodePadding } from '@angular/cdk/tree'; -import { Directive, Input, numberAttribute } from '@angular/core'; +import { Directive, forwardRef, Input, numberAttribute } from '@angular/core'; @Directive({ selector: '[nzTreeNodePadding]', - providers: [{ provide: CdkTreeNodePadding, useExisting: NzTreeNodePaddingDirective }], + providers: [{ provide: CdkTreeNodePadding, useExisting: forwardRef(() => NzTreeNodePaddingDirective) }], standalone: true }) export class NzTreeNodePaddingDirective extends CdkTreeNodePadding { diff --git a/components/tree-view/toggle.ts b/components/tree-view/toggle.ts index 05a0f44f02a..4c06cf3d3f1 100644 --- a/components/tree-view/toggle.ts +++ b/components/tree-view/toggle.ts @@ -4,7 +4,7 @@ */ import { CdkTreeNodeToggle } from '@angular/cdk/tree'; -import { booleanAttribute, Directive, Input } from '@angular/core'; +import { booleanAttribute, Directive, forwardRef, Input } from '@angular/core'; @Directive({ selector: 'nz-tree-node-toggle[nzTreeNodeNoopToggle], [nzTreeNodeNoopToggle]', @@ -17,7 +17,7 @@ export class NzTreeNodeNoopToggleDirective {} @Directive({ selector: 'nz-tree-node-toggle:not([nzTreeNodeNoopToggle]), [nzTreeNodeToggle]', - providers: [{ provide: CdkTreeNodeToggle, useExisting: NzTreeNodeToggleDirective }], + providers: [{ provide: CdkTreeNodeToggle, useExisting: forwardRef(() => NzTreeNodeToggleDirective) }], host: { class: 'ant-tree-switcher', '[class.ant-tree-switcher_open]': 'isExpanded', diff --git a/components/tree-view/tree-view.ts b/components/tree-view/tree-view.ts index feb7254bf55..fb74edb4b52 100644 --- a/components/tree-view/tree-view.ts +++ b/components/tree-view/tree-view.ts @@ -4,7 +4,14 @@ */ import { CdkTree } from '@angular/cdk/tree'; -import { AfterViewInit, ChangeDetectionStrategy, Component, ViewChild, ViewEncapsulation } from '@angular/core'; +import { + AfterViewInit, + ChangeDetectionStrategy, + Component, + forwardRef, + ViewChild, + ViewEncapsulation +} from '@angular/core'; import { treeCollapseMotion } from 'ng-zorro-antd/core/animation'; @@ -28,8 +35,8 @@ import { NzTreeView } from './tree'; encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [ - { provide: CdkTree, useExisting: NzTreeViewComponent }, - { provide: NzTreeView, useExisting: NzTreeViewComponent } + { provide: CdkTree, useExisting: forwardRef(() => NzTreeViewComponent) }, + { provide: NzTreeView, useExisting: forwardRef(() => NzTreeViewComponent) } ], host: { class: 'ant-tree', diff --git a/components/tree-view/tree-virtual-scroll-view.ts b/components/tree-view/tree-virtual-scroll-view.ts index 52679eb3008..da5e7343b72 100644 --- a/components/tree-view/tree-virtual-scroll-view.ts +++ b/components/tree-view/tree-virtual-scroll-view.ts @@ -8,6 +8,7 @@ import { BaseTreeControl, CdkTree, CdkTreeNodeOutletContext } from '@angular/cdk import { ChangeDetectionStrategy, Component, + forwardRef, Input, OnChanges, SimpleChanges, @@ -45,8 +46,8 @@ const DEFAULT_SIZE = 28; encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [ - { provide: NzTreeView, useExisting: NzTreeVirtualScrollViewComponent }, - { provide: CdkTree, useExisting: NzTreeVirtualScrollViewComponent } + { provide: NzTreeView, useExisting: forwardRef(() => NzTreeVirtualScrollViewComponent) }, + { provide: CdkTree, useExisting: forwardRef(() => NzTreeVirtualScrollViewComponent) } ], host: { class: 'ant-tree', diff --git a/schematics/ng-update/test-cases/config.ts b/schematics/ng-update/test-cases/config.ts index 88968c204a8..ca982b421be 100644 --- a/schematics/ng-update/test-cases/config.ts +++ b/schematics/ng-update/test-cases/config.ts @@ -5,12 +5,22 @@ export const SchematicsTestTsConfig = { compilerOptions: { - experimentalDecorators: true, lib: ['es2015'] } } export const SchematicsTestNGConfig = { version: 1, - projects: {t: {root: '', architect: {build: {options: {tsConfig: './tsconfig.json'}}}}} -} \ No newline at end of file + projects: { + t: { + root: '', + architect: { + build: { + options: { + tsConfig: './tsconfig.json' + } + } + } + } + } +} diff --git a/scripts/gulp/tsconfig.json b/scripts/gulp/tsconfig.json index 4a8f7145590..d6825106b8f 100644 --- a/scripts/gulp/tsconfig.json +++ b/scripts/gulp/tsconfig.json @@ -1,10 +1,11 @@ - { "compilerOptions": { - "experimentalDecorators": true, "noUnusedParameters": true, "noUnusedLocals": true, - "lib": ["es2015", "dom"], + "lib": [ + "es2015", + "dom" + ], "module": "commonjs", "moduleResolution": "node", "outDir": "../../dist", @@ -22,4 +23,4 @@ "files": [ "gulpfile.ts" ] -} \ No newline at end of file +} diff --git a/scripts/prerender/tsconfig.json b/scripts/prerender/tsconfig.json index ba505508dd4..1de206e6712 100644 --- a/scripts/prerender/tsconfig.json +++ b/scripts/prerender/tsconfig.json @@ -5,10 +5,16 @@ "sourceMap": true, "declaration": false, "moduleResolution": "node", - "experimentalDecorators": true, "target": "es5", - "typeRoots": ["../../node_modules/@types"], - "lib": ["es2017", "dom"] + "typeRoots": [ + "../../node_modules/@types" + ], + "lib": [ + "es2017", + "dom" + ] }, - "include": ["sitemap.ts"] + "include": [ + "sitemap.ts" + ] } diff --git a/tsconfig.json b/tsconfig.json index ff3ee52648c..3bc0db38b27 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,6 @@ "declaration": false, "moduleResolution": "node", "allowSyntheticDefaultImports": true, - "experimentalDecorators": true, "target": "ES2022", "lib": [ "es2020", @@ -41,4 +40,4 @@ } } } -} \ No newline at end of file +}