Quantcast
Viewing latest article 7
Browse Latest Browse All 9

Answer by Günter Zöchbauer for Angular2 - should private variables be accessible in the template?

Even though the code example indicates the question is about TypeScript it doesn't have the tag. Angular2 is also available for Dart and this is a notable difference to Dart.

In Dart the template can't reference private variables of the component class, because Dart in contrast to TypeScript effectively prevents access of private members from outside.

I still back @drewmoores suggestion to think about component and it's template as one unit though.

Update (TS)It seems with offline compilation access to private properties will become more limited in Angular2 TS as well https://github.com/angular/angular/issues/11422


Viewing latest article 7
Browse Latest Browse All 9

Trending Articles