我想在数据库中的数据还在加载的时候添加一个微调器,加载一开始就被分配为false,为此我在HTML文件中添加了以下代码
<div *ngIf="loading" class="text-center">
<div class="spinner-border text-warning" role="status">
<span class="sr-only">Loading...</span>
</div>
Fetching...
</div>
并在angular.json中加入以下内容
"styles": [
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css" ],
"scripts": ["./node_modules/jquery/dist/jquery.min.js",
"./node_modules/popper.js/dist/umd/popper.min.js"
"./node_modules/bootstrap/dist/js/bootstrap.min.js"]
我已经正确地安装了bootstrap,但我还是得到了这个错误--发生了未处理的异常。脚本文件.node_modulesbootstrapdistjsbootstrap.js不存在.更多细节请参见"\angular-errors.log"。
当我进入错误日志时,我得到这个-[错误]Error.Node_modulesbootstrapdistjsbootstrap.js不存在。脚本文件.node_modulesbootstrapdistjsbootstrap.js不存在。
我导航到的位置和bootstrap.js文件是在该位置。我知道这是一个小问题,但我无法加载风格不解决这个问题。
你忘了在bootstrap文件前加上','(逗号)。
你的代码。
"scripts": ["./node_modules/jquery/dist/jquery.min.js",
"./node_modules/popper.js/dist/umd/popper.min.js"
"./node_modules/bootstrap/dist/js/bootstrap.min.js"]
应该是。
"scripts": ["./node_modules/jquery/dist/jquery.min.js",
"./node_modules/popper.js/dist/umd/popper.min.js",
"./node_modules/bootstrap/dist/js/bootstrap.min.js"]
找到答案了,我不知道是怎么发生的,但是我的angular.json里有多个Script和Styles标签,可能是因为我在解决这个错误的时候更新的比较频繁吧!但是当我用正确的标签提到脚本和样式文件的位置的时候,它就解决了。