1.cnpm install ngx-bootstrap bootstrap --savecss
※可能缺乏jquery cnpm i jquerynode
2. 打开 angular-cli.json (项目根目录下)jquery
style 节点 增长npm
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"styles.css",
],json
script: 节点增长:bootstrap
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.bundle.js"
],spa
若是 引入"../node_modules/bootstrap/dist/js/bootstrap.min.js" 会缺乏 popper,js.(bootstrap4 里面集成了popper,也能够cnpm 安装)ip
3.打开 style.css (项目根目录下)angular
增长:@import '~bootstrap/dist/css/bootstrap.min.css';import