I wonder if it's possible to use an arrow function in a component like this in Angular
<app-child [showItemCondition]="item => item.isVisible" [list]="items"></app-child>
Any functions cannot be defined in templates. To make it possible, then we need to eval those code in JIT compilation mode.
Prohibition to use arrow function allows to get rid of unnecessary code (DRY and KISS) and as a result:
If you need a function, it should be defined as component class method. It can be either regular or arrow function.
If logic will be placed in template, it means:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With