【发布时间】:2018-03-21 11:56:57
【问题描述】:
我在我的应用程序中使用 VS2015 和 angular 2。从角度快速启动解决方案创建应用程序,为了使用引导 css,我从 nuget 下载了引导和 jquery 库。我通过从 Content and scripts 文件夹中拖动文件添加了这些引用。
<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.cssnet::ERR_ABORTED http://localhost:2123/scripts/jquery-3.2.1.min.jsnet::ERR_ABORTED http://localhost:2123/scripts/bootstrap.min.js 404(未找到)
我尝试了以下
href="~/Content/ , href="./Content/ , href="Content/ Etc.
但它仍然没有加载。如何将这些文件添加到索引页面?我是 angular2 的新手,请给我一个解决方案。
【问题讨论】:
-
您可以添加资产文件夹并将所有文件添加到资产中,然后像这样在 HTML 中加载
标签: jquery twitter-bootstrap angular visual-studio