--

Love the pipe for function calling in the template. Another way of avoiding the infinite function calls inside the template when the change detection is executed is using changeDetection: ChangeDetectionStrategy.OnPush in the component definition. The 'problem' (not really a problem) is that you need to handle template updates using ChangeDetectorRef.

Moral of the story is that you should not use function calls in a template, unless those functions are signals or actions for a certain user event.

--

--

Jose I Santa Cruz G
Jose I Santa Cruz G

Written by Jose I Santa Cruz G

Polyglot senior software engineer, amateur guitar & bass player, geek, husband and dog father. Not precisely in that order.

Responses (2)