【发布时间】:2018-02-07 17:05:06
【问题描述】:
我有两个类似的非常小的示例 Angular 应用程序,它们集成了 Bootstrap CSS。一个有效,一个我自己创建的无效。目前还不清楚有什么区别以及为什么它在我的情况下不起作用。
我的步骤如下:
npm install bootstrap --save
这会更新package.json,然后我更新index.html 并添加
<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">
与工作应用程序完全相同的行,但在我使用 ng new new-app 创建的示例应用程序中,它不起作用。
chrome 中的网络标签显示 404。基本上找不到 URL http://localhost:4200/node_modules/bootstrap/dist/css/bootstrap.min.css。
在 Angular 应用程序中集成 Bootstrap CSS 的正确/完整方法是什么?
【问题讨论】:
-
@brk 的 asnwer 可以解决问题,如果不是,您总是可以在 index.html 中使用 CDN 来工作
标签: javascript css angular