From f736bea8ee6731b0158eafcea263edebf4c7d2f9 Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Mon, 13 May 2024 08:59:43 -0700 Subject: [PATCH] refactor(core): deprecate `@Component.interpolation` (#55778) Angular has long had the ability to use different interpolation delimiters (by default `{{` and `}}`). This concept was copied over from AngularJS, where AngularJS syntax is included in HTML sent over the network to the browser. Occasionally developers would use SSR frameworks which _also_ have interpolation syntaxes of their own, so there was a need to change the delimiters used by AngularJS to avoid conflicts. Since Angular templates are always processed by our compiler and the interpolation characters are never processed by other systems first, this option is vestigial in Angular and only increases the complexity of our parser. DEPRECATED: `@Component.interpolation` is deprecated. Use Angular's delimiters instead. PR Close #55778 --- goldens/public-api/core/index.md | 1 + packages/core/src/metadata/directives.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/goldens/public-api/core/index.md b/goldens/public-api/core/index.md index 45067475456..65c9c1b1d8b 100644 --- a/goldens/public-api/core/index.md +++ b/goldens/public-api/core/index.md @@ -227,6 +227,7 @@ export interface Component extends Directive { changeDetection?: ChangeDetectionStrategy; encapsulation?: ViewEncapsulation; imports?: (Type | ReadonlyArray)[]; + // @deprecated interpolation?: [string, string]; // @deprecated moduleId?: string; diff --git a/packages/core/src/metadata/directives.ts b/packages/core/src/metadata/directives.ts index cd6b9cd12d0..832183e2c81 100644 --- a/packages/core/src/metadata/directives.ts +++ b/packages/core/src/metadata/directives.ts @@ -625,6 +625,8 @@ export interface Component extends Directive { /** * Overrides the default interpolation start and end delimiters (`{{` and `}}`). + * + * @deprecated use Angular's default interpolation delimiters instead. */ interpolation?: [string, string];