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

290
Visualizações
Angular2 vs jQuery: Can jQuery actually cancel angular's bindings?

So first, before you bite my head off, I would NEVER use jQuery in an angular project... never ever... but the client really wants it even if strongly objecting...

AND for future readers... NEVER use jquery on Angular project... there is NO need

Now, that we cleared that up :)

Angular(2) app binds some default click events to some links / buttons...

The clients wants to be able to overwrite the events with jQuery...

this is the pretty standard jQuery code I put in

jQuery( document ).ready(function() {
    jQuery(document).on("click", '.b-button button', function (event) {
        console.log( "clicked!" );
        console.log(event);
        event.preventDefault();
        event.stopPropagation();
        return false;
    });
});

While the event is triggered, it seems I cannot cancel it or prevent propagation... angular2 still takes over

what would be the proper way?

for the reference, using 3.2.1 slim version of jQuery

over 4 years ago · Santiago Trujillo
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