安装

作者: c59ffede9db6 | 来源:发表于2017-05-13 01:15 被阅读0次
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

相关文章

网友评论

      本文标题:安装

      本文链接:https://www.haomeiwen.com/subject/knatxxtx.html