Encountering an issue while attempting to utilize external jQuery files from a CDN. Typically, jQuery files should be included at the top alongside other custom jQuery files.
Despite arranging the files in the angular.json file, I continue to face an error that persists regardless of how I adjust the order.
Displayed below are images of my setup and the accompanying error message.
Error in Angular due to importing external custom jQuery files from a CDN []
Arrangement in my angular.json file to prioritize jQuery at the top
"styles": [
"src/styles.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/assets/css/customcss.css"
],
"scripts": [
"./node_modules/jquery/dist/jquery.js",
"./node_modules/jquery/dist/jquery.min.js",
"./node_modules/jquery/dist/jquery.slim.min.js",
"./node_modules/popper.js/dist/umd/popper.min.js",
"./node_modules/bootstrap/dist/js/bootstrap.min.js",
"src/assets/js/custom.js"
]
Incorporating the external custom jQuery library into my Angular index.html page
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> My site </title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<!-- custom css -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.min.css">
</head>
<body>
<!-- jQuery Custom Scroller CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.concat.min.js"></script>
<app-root></app-root>
</body>
</html>