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