Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAOT Compiler requires public properties, while non-AOT allows private properties #37660
Milestone
Comments
I too had to remove all private properties when migrating components to library. A bit odd because the final JavaScript does not have private properties. Visual Studio Code automatically makes refactored methods private. So this problem is at odds with default VSCode refactoring. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Relevant Package
This feature request is for @angular/coreDescription
A clear and concise description of the problem or missing capability...Here we are, 2 years later, and the Ivy compiler seems to behave in the same way. Still I can't access private properties in templates (or at least protected).
Describe the solution you'd like
If you have a solution in mind, please describe it.I think the generated class for the View, should extend the factory component class, like this, making it at least possible to access protected properties.
Describe alternatives you've considered
Have you considered any alternative solutions or workarounds?The alternative is very poor. I have to use a
BaseComponent
class, so all my components need to extend this class. Then, in theBaseComponent
I have a getter, calledview
, like this:I think this is not very optimal.
Did I miss something? Can Ivy compiler in Angular 9 access the private properties in the components?