javascript - 不知何故,我的 bootstrap 和 jquery 文件拒绝在 Angular 项目中加载
问题描述
我在我的 Angular 项目中通过以下命令安装了引导程序
npm install --save bootstrap jquery
"styles": [
"../node_modules/bootstrap/scss/bootstrap.scss",
"styles.scss"
]
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js"
]
问题是 sass 文件在我将它导入到 sass 文件之前才起作用,这意味着我的 angular.json 配置不起作用
@import "~bootstrap/scss/bootstrap.scss";// this worked
请提供任何帮助,因为我已经在它工作的其他项目中使用它,而在其他项目中它不起作用。我想知道做错了什么。
解决方案
使用这种方法
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.css"
]
推荐阅读
- android - 为什么 react native android app 经常崩溃?
- javascript - 如何使用js将光标聚焦在textarea中的特定点?
- javascript - 如何在 Angular 1.5 中重定向时访问服务器生成的 http 请求的表单数据
- mysql - 计算不同行的日期时间差异并将它们相加以获得总计
- microsoft-graph-api - 通过 Graph API 处理 OneNote 页面内容
- azure - c# 中的 Azure 云配置
- git - 如何使 .gitignore 忽略文件?
- r - R:没有ggplot的绘图
- php - 身份验证中间件未重定向到登录页面
- c++ - 使用内置 std::sort 函数在 C++ 中对二维数组进行排序