--

You actually can, but it's a terrible practice, just as implementing ngOnChanges. Every change detection cycle will trigger the function (try it with a console.log and watch the console drive crazy). A way of solving this is using the OnPush change detection strategy and changeDetectorRef.markForCheck() on every piece of code that requires it. But still, it is a terrible practice.

--

--

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.

No responses yet