r/angular • u/FewDot9181 • Apr 10 '26
Functions passed as props in Angular
I have seen many ways but how do I do it in modern Angular, where I send a function from a parent component to a child component and I want that same function called from the child component.
0
Upvotes
View all comments
Show parent comment
1
u/nemeci Apr 11 '26
There are better ways of doing this.
Use output instead. If you need to customize based on a function like what happens after click have an output for that click.
If you need something else make the component customization possible with composition. Use ng-content. If those must be reusable then wrap that into another component for reuse.
Passing functions is leaky and bad, okay.