在角度6中使用bootstrap 3 [英] use bootstrap 3 in angular 6
本文介绍了在角度6中使用bootstrap 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何在角度6中使用bootstrab 3?它以任何方式都无法工作,我用过:
how i can use bootstrab 3 in angular 6 ?? it's not work in any way , i used :
npm install bootstrap@3 jquery --save
然后按以下方式更新angular.json:
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"
]
在html bootstrap类中出现
,但是它不起作用!这是git这个错误
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'
推荐答案
INSTALL BOOTSTRAP(所有引导程序都安装在node_module文件夹中)
INSTALL BOOTSTRAP (All bootstrap installed in node_module folder)
npm install bootstrap@3 jquery --save
Angular.json文件
Angular.json file
将样式和脚本文件添加到Angular.json以进行全球化
Add styles and scripts file to Angular.json for globalise
"styles": [
"src/styles.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": [
"node_modules/bootstrap/dist/js/bootstrap.min.js",
"node_modules/jquery/dist/jquery.min.js"
]
component.html
component.html
<a class="btn btn-lg btn-primary" href="" role="button">View</a>
这篇关于在角度6中使用bootstrap 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文