In my.component.html I have:
<div class="my-label" *ngIf="isMyProperty()">
In myParent.class.ts (abstract class MyParent) I have:
// overridden in derived classes
abstract isMyPropoerty(): boolean;
In myChild.class.ts (export class MyChild extends MyParent) I have:
// derived method, return true
isMyProperty(): boolean {return true; }
Now this works "fine", but for every mouse move event in the browser, isMyProperty()
is called, so I need to replace it with a variable, so that I have in my.component.html variable instead of the method call:
<div class="my-label" *ngIf="isMyProperty">
Additionally, isMyProperty needs to be accessible also in the classes that use:
@ViewChild(MyChild) myChild: MyChild;
I am sorry that I was not able to explain problem better.