In our components of our Angular 2 / Ionic 2 project (final / rc0), I use:
protected contentTarget: ViewContainerRef;
ngOnInit() {
this.contentTarget.createComponent(componentFactory);
}
AoT compiler says:
Error at ....: Property 'contentTarget' is protected and only accessible within class 'IncludeTemplateComponent' and its subclasses.
A variable (property) is not used anywhere in the whole project.
So ... can anyone shed some light on this, is createComponent factory passing the contentTarget variable to its child element, or why the compiler doesn't like to defend itself here? Are variables βforbiddenβ protected in all Angular2?
source
share