Angular 2 rc 6
, typescript 2
, node 4.5.0
, npm 2.15.9
on Windows 7
I\'m trying to move from Just-in-T
So is too, in Final release of Angular 2 whit Ionic2 RC1
A workaround for Fields could be to use getters without setters
protected _myField: any;
get myField(): any {
return this._myField;
}
You can also see other JiT to AoT considerations to adapt your code in this blog of Isaac Mann
For a given component all its members (methods, properties) accessed by its template must be public in the ahead-of-time compilation scenario. This is due to the fact that a template is turned into a TS class. A generated class and a component are 2 separate classes now and you can't access private members cross-class.
In short: you can't access private members in your templates if you want to use ahead-of-time compilation.