Angular 无法在中添加引导

Angular 无法在中添加引导,angular,bootstrap-4,angular5,Angular,Bootstrap 4,Angular5,嗨,我正在使用Angular 5,我正在尝试在代码中导入引导,但无法这样做。我已使用以下方法安装引导程序: npm install --save bootstrap 我还将css文件添加到.angular-cli.json中,如下所示: "styles": ["../node_modules/bootstrap/dist/css/bootstrap.min.css", "../node_modules/bootstrap/dist/css/bootstrap.css", "st

嗨,我正在使用Angular 5,我正在尝试在代码中导入引导,但无法这样做。我已使用以下方法安装引导程序:

npm install --save bootstrap
我还将css文件添加到.angular-cli.json中,如下所示:

"styles": ["../node_modules/bootstrap/dist/css/bootstrap.min.css",
    "../node_modules/bootstrap/dist/css/bootstrap.css",
    "styles.css"
],
但当我在google chrome中检查我的代码时,我得到的是

<!doctype html>
<html lang="en">
   <head>
      <meta charset="utf-8">
      <title>MyFirstApp</title>
      <base href="/">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="icon" type="image/x-icon" href="favicon.ico">
   </head>
   <body>
      <app-root></app-root>
      <script type="text/javascript" src="inline.bundle.js"></script><script type="text/javascript" src="polyfills.bundle.js"></script><script type="text/javascript" src="styles.bundle.js"></script><script type="text/javascript" src="vendor.bundle.js"></script><script type="text/javascript" src="main.bundle.js"></script>
   </body>
</html>

MyFirstApp
标题部分中没有用于引导的样式。请帮帮我。我被卡住了

“/。/node\u modules/bootstrap/dist/css/bootstrap.css”, ../../node_modules/bootstrap/dist/css/bootstrap.min.css“


像这样使用将样式
bootstrap.min.css
添加到
style.css
main:

@import "../src/css/bootstrap.min.css";

试试这个,将你的样式
bootstrap.min.css
添加到
style.css


@import../node\u模块/bootstrap/dist/css/bootstrap.min.css";

停止应用程序并在终端上重新启动。重新启动进程后,将应用
.angular cli.json
中的更改。您不必同时导入bootstrap.min.css和bootstrap.css。css只是bootstrap.css的缩小版。虽然我知道这并不能解决你的问题,但我已经做了这两件事,因为缩小版也不能像你在上面的源代码视图中看到的那样工作。我已多次启动该应用程序。@AnkitKathait尝试删除/angular-cli.json中的引导css项,并添加
@import“node_modules/bootstrap/scss/bootstrap”到style.scss在我们的角度投影中如果您没有使用.scss,那么您应该实际尝试。太棒了!