首页 文章

Angularjs2表单文件样本,bootstrap.min.css没有下载

提问于
浏览
0

我正在跟踪来自anuglar文件的样本https://angular.io/docs/ts/latest/guide/forms.html

在我的html文件头中,我添加了bootstrap.min.css参考 . 当我刷新它给这个URL的404返回代码 .

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

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

为什么它给404 File Not Found返回代码?

谢谢SR

以下答案适合我 . 但是从chrome网络连接没有显示css被下载到浏览器 .

enter image description here

1 回答

  • 0

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

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

    你可以看到我这个演示here

相关问题