问题
how i can use bootstrab 3 in angular 6 ?? it's not work in any way , i used :
npm install bootstrap@3 jquery --save
then update angular.json as follow :
"styles": [
"src/styles.css",
"../../node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": [
"../../node_modules/jquery/dist/jquery.min.js",
"../../node_modules/bootstrap/dist/js/bootstrap.min.js"
]
in html bootstrap class appear , but it dosen't work !! it's git this error
91% additional asset processing scripts-webpack-plugin× 「wdm」: Error: ENOENT: no such file or directory, open 'E:\node_modules\jquery\dist\jquery.min.js'
回答1:
To achieve expected result, update your node_modules location as below
"styles": [
"src/styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js"
]
code sample - https://stackblitz.com/edit/angular-oyxshp?file=angular.json
回答2:
i solve it
"styles": [
"src/styles.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js"
]
来源:https://stackoverflow.com/questions/50380019/use-bootstrap-3-in-angular-6