From 4108efaee6d4eb3dd86ed045f95f27d7fe58e9bc Mon Sep 17 00:00:00 2001 From: Jan Martin Date: Fri, 9 May 2025 11:51:33 -0700 Subject: [PATCH] docs: document the use of `this` in template expression syntax (#61250) As of Angular 19, `this` should consistently reference the given class property. See: https://github.com/angular/angular/pull/55183 Co-authored-by: Jeremy Elbourn Co-authored-by: Matthieu Riegler PR Close #61250 --- adev/src/content/guide/templates/expression-syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adev/src/content/guide/templates/expression-syntax.md b/adev/src/content/guide/templates/expression-syntax.md index b2dd034c8d0..d704531d25d 100644 --- a/adev/src/content/guide/templates/expression-syntax.md +++ b/adev/src/content/guide/templates/expression-syntax.md @@ -98,7 +98,7 @@ Angular expressions additionally also support the following non-standard operato Angular expressions are evaluated within the context of the component class as well as any relevant [template variables](/guide/templates/variables), locals, and globals. -When referring to class members, `this` is always implied. +When referring to component class members, `this` is always implied. However, if a template declares a [template variables](guide/templates/variables) with the same name as a member, the variable shadows that member. You can unambiguously reference such a class member by explicitly using `this.`. This can be useful when creating an `@let` declaration that shadows a class member, e.g. for signal narrowing purposes. ## Declarations