I'm trying to implement a directive to implement the one time binding so when I use this directive I want to use the one time binding.
I made this example; https://stackblitz.com/edit/angular-bhayzy
In my HTML I have:
<div>
message: {{labels.message('hello')}}
</div>
<div *oneTime>
message one-time: {{labels.message('secondHello')}}
</div>
Labels is a class with message function:
public static message(field): string {
console.log('called: ', field);
return this.MYCLASS.LABELS[field] || 'no message';
};
Starting the application I get 6 console with the message, 3 for 'hello' but also 3 for 'secondHello' but in this HTML element I have the *oneTime.
Debugging OneTimeDirective it seems I never enter in the directive...