Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

274
Vistas
Fullcalendar 5 with Angular: Component inside Event

Recently, my company switched from AngularJS to Angular 12. Now I am using Fullcalendar version 5 instead of version 3. I am using the Angular implementation of Fullcalendar:https://fullcalendar.io/docs/angular

Obviously, many things don't work anymore. See the following image to get an understanding of what I want to achieve:enter image description here As you can see, there is custom HTML inside the event. It is not hard to render custom HTML there, but there is a button in the top right corner of every event that copies the event. When I was using angularJS, this worked fine as I was able to call functions in the angularJS controller. This does not work anymore.

I struggle to find a proper solution for triggering a function inside the angular context, but failed to find anything useful on the internet. The main issue is that I can write all the custom HTML that I want, but the content is not compiled by angular (or rather, outside of angular scope), therefore a simple (click)="copyEvent(event)" wont work. I know I could do some hacky approach by using onclick="hackyFunction(eventId)" to trigger the click, but I'd rather use a real angular component inside the event. Do you have any suggestions on how to approach this issue?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

So I was not able to find any proper way of injecting a component into the event, so I came up with this hacky solution: enter image description here As you can see, Im using the EventRenderHook to render my custom HTML. To make it possible to access the Angular context, i used "window.autoswitch.functionName". Autoswitch in this case is just a variable I generated on the window as a reference to the component: (window as any).autoswitch = this; "this" is the component. I wrote this statement in "ngOnInit()"

The functions were added simply like that: enter image description here

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda