我在我的应用程序中使用 VS2015 和 Angular 2。从 Angular 快速启动解决方案创建应用程序,为了使用 bootstrap css,我从 nuget 下载了 bootstrap 和 jquery 库。我通过从内容和脚本文件夹中拖动文件来添加这些引用。
<link href="../Content/bootstrap.css" rel="stylesheet" />
<script src="../scripts/jquery-3.2.1.min.js"></script>
<script src="../scripts/bootstrap.min.js"></script>
运行应用程序时显示以下错误
http://localhost:2123/Content/bootstrap.css net::ERR_ABORTED http://localhost:2123/scripts/jquery-3.2.1.min.js net::ERR_ABORTED http://localhost:2123/scripts/bootstrap.min.js 404 (Not Found)
我尝试了以下
href="~/Content/ , href="./Content/ , href="Content/ Etc.
但仍然没有加载。如何将这些文件添加到索引页中?我是 angular2 的新手,请建议我一种解决方案。
最佳答案
关于jquery - 如何在不使用 Angular CLI 的情况下在索引页中添加 bootstrap 和 JQuery 引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47794427/