如何在没有Angular CLI的情况下在索引页面中添加bootstrap和JQuery引用

San*_*v S 1 jquery visual-studio twitter-bootstrap angular

我在我的应用程序中使用VS2015和角度2.从角度快速启动解决方案创建应用程序,为了使用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>
Run Code Online (Sandbox Code Playgroud)

运行应用程序时,它显示错误

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(未找到)

我试过以下

href="~/Content/ , href="./Content/ ,  href="Content/ Etc.
Run Code Online (Sandbox Code Playgroud)

但它仍然没有加载.如何将这些文件添加到索引页面?我是angular2的新手请给我一个解决方案.

Dip*_*iya 8

您可以将所需文件放在解决方案的ASSETS文件夹中.添加这些文件后,您必须将这些文件的引用添加到angular.cli.json文件中.

有关详细信息,请参阅以下快照.

在此输入图像描述