I am trying to install jquery
and jquery-slimscroll
packages to an Angular project (version > 10), but the packages are not seems to be installed properly. So, regarding to this issue, could you please clarify me about the following issues below?
Assume that I have the following client structure:
ClientApp ---
|--- node_modules
|--- package.json
|--- angular.json
1. What is the proper way to add jquery
and jquery-slimscroll
to the project?
Should I run npm install
on the ClientApp folder? Or is there a better way for the latest Angular versions?
2. I think there are several ways to add these packages as script like the following:
in angular.json
:
"scripts": [
".../jquery/dist/jquery.min.js",
".../jquery-slimscroll/jquery.slimscroll.js",
]
Is it not a good approach to add them like this? Should I add them in npm as in the 1st question?
3. What about the packages.json
? Some packages are added to packages.json
instead of angular.json
. What is the difference and why some packages are added another?
question from:
https://stackoverflow.com/questions/65870148/proper-way-to-add-jquery-packages-to-an-angular-10-project 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…