I am trying to trigger an event when a user clicks on a resource:
I am wondering how I can do this in Angluar? I have seen posts for react but I am not sure if someone has managed to do it in Angluar?
I am trying to trigger an event when a user clicks on a resource:
I am wondering how I can do this in Angluar? I have seen posts for react but I am not sure if someone has managed to do it in Angluar?
If you are using FullCalnedar-5 https://fullcalendar.io/docs/resource-render-hooks
You can use resourceLabelDidMount
like the following:
public calendarOptions: CalendarOptions
ngOnInit(): void {
this.calendarOptions = {
...,// other features
resourceLabelDidMount: this.resourceRender.bind(this)
}
}
private resourceRender({ el , resource }) {
console.log(resource)// more info about resource
el.addEventListener("click", function () {
// do what you want
});
}