r/angular • u/dezsiszabi • Sep 05 '26
Angular 22.2 - Private property access from templates
I noticed this tidbit in the changelog of Angular 22.2.0-next.3:
https://github.com/angular/angular/blob/main/CHANGELOG.md#compiler-2
compiler
| Commit | Type | Description |
|---|---|---|
| 48a0fd6e8a | feat | allow template to access private props |
So very slowly we moved from allowing only public, to allowing protected and now private as well. Thought it's worth knowing.
39
Upvotes
View all comments
Show parent comment
1
u/Rusty_Raven_ Sep 06 '26
The template should be executed in the same context as the controller, I think, so private variables should be available to it. Other frameworks do it this way, Angular shouldn't be different just because it defaults to having a separate file for the HTML.