簡體   English   中英

Angular 6添加jquery,popper和bootstrap js

[英]Angular 6 add jquery, popper and bootstrap js

我正在使用angular 6和sass bootstrap項目,我正在嘗試在angular.json中添加jquery,popper和js

我在angular.json中的代碼是:

"styles": [
          "src/styles.scss"
        ],
        "scripts": [
          "../node_modules/jquery/dist/jquery.min.js",
          "../node_modules/popper.js/dist/popper.min.js",
          "../node_modules/bootstrap/dist/js/bootstrap.min.js"
        ]

我也嘗試過這個:

 "styles": [
          "src/styles.scss"
        ],
        "scripts": [
          "./node_modules/jquery/dist/jquery.js",
          "./node_modules/popper.js/dist/popper.js",
          "./node_modules/bootstrap/dist/js/bootstrap.js"
        ]

但是切換和下拉菜單對我沒用。

 npm install bootstrap to install boostrp
 npm install jquery to install jquery and add path under the 'build' inside 
 angular.json

"styles": [
          "src/styles.css", "node_modules/bootstrap/dist/css/bootstrap.min.css"
        ],
"scripts": ["node_modules/bootstrap/js/jquery.min.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js"]

Please verify the file inside the node_modules.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM