1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Angular web component dont work on side of JQuery

Discussão em 'Angular' iniciado por Albanninou, Agosto 22, 2025.

  1. Albanninou

    Albanninou Guest

    i try to make some angular web component for improve some component on a JEE application but it broke with Jquery.

    I have make a minimal test to reproduce the error.

    <html>
    <head>
    <script src="./jquery.min.js"></script>
    <script src="./main.js"></script>
    </head>
    <body>
    <app-test></app-test>
    <button id="testBtn">Click</button>
    <script>
    $("#testBtn").click(function () {
    alert("jQuery fonctionne !");
    });
    </script>
    </body>
    </html>


    If i comment script mains.js, jquery work and if i comment

    <script>
    $("#testBtn").click(function () {
    alert("jQuery fonctionne !");
    });
    </script>


    my angular component work, but the two together i have an error on main.js:4 ERROR TypeError: $ is not a function

    I dont know how solve this. I have make a stackblitz minimal reproduction

    Continue reading...

Compartilhe esta Página