Run method of the child component


I’ve 2 components. I’ve the written hours comp with a in it from the flex-calendar comp.

I want to have a button in the written-hours page that triggers the renderCalendar method in the flexCalendar.

I use EventMiter to communicate with the written-hours page FlexCalendar -> writtenHours.DateChange() but now i want:

buttonClick (written-h.) -> written-hours.gotoToday() -> flex-Calendar.goToDate(date)

Does someone know how to do this?

1 Like

In angular 2 there is such things as ViewChild and ViewChildren:

Maybe this will help you.
Simply by using this you can access underlying components and their’s methods and properties

You could use @Output/@Input

Thank you this fixed my problem!