Angular入门(三) 引入boostrap4

1.cnpm install ngx-bootstrap bootstrap --save

   ※可能缺少jquery  cnpm i jquery

2.  打开 angular-cli.json (项目根目录下)

      style 节点 增加

  "styles": [
    "../node_modules/bootstrap/dist/css/bootstrap.min.css",
    "styles.css",
  ],

     script: 节点增加:

  "scripts": [
    "../node_modules/jquery/dist/jquery.min.js",
    "../node_modules/bootstrap/dist/js/bootstrap.bundle.js"
  ],

如果 引入"../node_modules/bootstrap/dist/js/bootstrap.min.js" 会缺少 popper,js.(bootstrap4 里面集成了popper,也可以cnpm  安装)

3.打开 style.css (项目根目录下)

  增加:@import '~bootstrap/dist/css/bootstrap.min.css';

 

posted @ 2017-12-13 10:46  tony_zhu  阅读(1199)  评论(0编辑  收藏  举报