I wanted use a jquery function that uses an external library inside my component so Ive added its library in angular.json
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/popper.js/dist/umd/popper.min.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js",
"src/html5media.min.js",
"src/plyr.min.js",
]
otherwise i even used this libraries as main index.html file
<link rel="stylesheet" href="https://cdn.plyr.io/3.5.6/plyr.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5media/1.1.8/html5media.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/plyr/3.5.6/plyr.min.js"></script>
</head>
then imported jquery function in my component
import * as $ from 'plyr';
as you can see on below link, this jquery function uses a class (Plyr) that should be refer to library link but when i serve my projects, see this error:
error TS2304: Cannot find name 'jQuery'.
37 jQuery(function ($) {
~~~~~~
and an interesting, when i resave save component file, it works but inside terminal the error remains:
error TS2304: Cannot find name 'Plyr'.
35 var player = new Plyr('#audio1', {
~~~~
the mentioned jquery file: