Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

271
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda