cnpm i @angular/cli -g
ng -v 检测
cd c:/project
ng new auction (耐心等待,大概10几分钟吧会自动下载120m的东西)
cd auction
cnpm i jquery bootstrap --save
.angular-cli.json 配置
"styles": [
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.js",
"../node_modules/bootstrap/dist/js/bootstrap.js"
],
经测试上面的配置无效
"styles": [
"styles.css",
"../node_modules/_bootstrap@3.3.7@bootstrap/dist/css/bootstrap.css"
],
"scripts": [
"../node_modules/_jquery@3.2.1@jquery/dist/jquery.js",
"../node_modules/_bootstrap@3.3.7@bootstrap/dist/js/bootstrap.js"
],
这样就可以了
此时还不行,还需要安装typescript类型描述文件,这样就可以认识jquery的$和bootstrap了
cnpm i @types/bootstrap --save-dev
cnpm i @types/jquery --save-dev
网友评论