mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
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 <jelbourn@google.com> Co-authored-by: Matthieu Riegler <kyro38@gmail.com> PR Close #61250
This commit is contained in:
parent
8e78b4e438
commit
4108efaee6
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue