use bootstrap 3 in angular 6

非 Y 不嫁゛ 提交于 2019-12-12 18:37:34

问题


how i can use bootstrab 3 in angular 6 ?? it's not work in any way , i used :

npm install bootstrap@3 jquery --save

then update angular.json as follow :

"styles": [
          "src/styles.css",
          "../../node_modules/bootstrap/dist/css/bootstrap.min.css"

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

in html bootstrap class appear , but it dosen't work !! it's git this error

91% additional asset processing scripts-webpack-plugin× 「wdm」: Error: ENOENT: no such file or directory, open 'E:\node_modules\jquery\dist\jquery.min.js'

回答1:


To achieve expected result, update your node_modules location as below

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

code sample - https://stackblitz.com/edit/angular-oyxshp?file=angular.json




回答2:


i solve it

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


来源:https://stackoverflow.com/questions/50380019/use-bootstrap-3-in-angular-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!