|
通过这个命令去添加依赖。
cd到项目目录=》- cnpm install jquery --save
复制代码 - cnpm install bootstrap@3.3.7 --save
复制代码 【引用过去版本 就在后面@个版本号】
--save 就是将要安装的依赖写到package.json的dependencies 对象中去
【不确定】是将要安装的依赖写到package.json的devDependencies 对象中去
引入 bootstrap的位置:
第一种:angular-cli.json的
- "styles": [
- "styles.css", "../node_modules/bootstrap/dist/css/bootstrap.min.css"
- ]
复制代码
第二种:styles.css 加入
- @import url("../node_modules/bootstrap/dist/css/bootstrap.min.css");
复制代码 |
|