安装

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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容