I want to use jquery in angle 5 but I get the following error How do I solve this?

0

I want to use jquery in a typescript file but when compiling I get the error in the attached image !! I open the browser console and there are no errors. I'm using visual studio code. Please help me

    
asked by Juan Pablo Pachar Viñan 19.02.2018 в 22:10
source

1 answer

0

In your typescript file you have to declare a variable before @component({...

declare var $:any;

And you have to put in your index.html your file jquery

Example:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    
answered by 22.02.2018 / 21:12
source