Angularjs2 表单文档示例,bootstrap.min.css 未下载

Angularjs2 form document sample, bootstrap.min.css not downloading

我正在关注来自 anuglar 文档的示例 https://angular.io/docs/ts/latest/guide/forms.html

在我的 html 文件头中,我添加了 bootstrap.min.css 参考。当我刷新它给出的 404 return 代码时 URL.

http://localhost:4200/node_modules/bootstrap/dist/css/bootstrap.min.css

我在文件系统中看到文件。使用 angular-cli 创建项目,运行 它处于开发模式。

为什么它给出 404 文件未找到 return 代码?

谢谢 SR

以下答案对我有用。 但是 chrome 网络连接没有显示 css 正在下载到浏览器。

使用您在上面的评论中提到的版本,您可以设置对样式文件的引用,该文件将包含在您的应用程序中

angular-cli.json 中,将 CSS 文件的路径添加到 styles 数组中。您还可以删除添加到 index.html 的引用,因为 webpack 构建过程会为您添加引用的 CSS 文件,只需将其添加到 angular-cli.json

你可以看我演示这个here