Skip to content

Commit fe3dd08

Browse files
committed
fix(@schematics/angular): remove experimentalDecorators from new projects
`experimentalDecorators: true` was required to use constructor DI. With recommendation now to use `inject` for DI, new projects don't need the experimental decorators anymore.
1 parent d134fa1 commit fe3dd08

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

packages/schematics/angular/workspace/files/tsconfig.json.template

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"noFallthroughCasesInSwitch": true,<% } %>
1111
"skipLibCheck": true,
1212
"isolatedModules": true,
13-
"experimentalDecorators": true,
1413
"importHelpers": true,
1514
"target": "ES2022",
1615
"module": "preserve"

tests/legacy-cli/e2e/tests/i18n/setup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export async function setupI18nConfig() {
100100
await writeFile(
101101
'src/app/app.ts',
102102
`
103-
import { Component, Inject, LOCALE_ID } from '@angular/core';
103+
import { Component, inject, LOCALE_ID } from '@angular/core';
104104
import { DatePipe } from '@angular/common';
105105
import { RouterOutlet } from '@angular/router';
106106
@@ -110,7 +110,7 @@ export async function setupI18nConfig() {
110110
templateUrl: './app.html'
111111
})
112112
export class App {
113-
constructor(@Inject(LOCALE_ID) public locale: string) { }
113+
location = inject(LOCALE_ID);
114114
title = 'i18n';
115115
jan = new Date(2000, 0, 1);
116116
minutes = 3;

tests/legacy-cli/e2e/tests/vitest/tslib-resolution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default async function () {
1414
'src/app/custom-decorator.ts',
1515
`
1616
export function MyDecorator() {
17-
return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
17+
return function (value: any, context: ClassMethodDecoratorContext) {
1818
// do nothing
1919
};
2020
}

0 commit comments

Comments
 (0)