Angular.json样式和脚本不起作用

时间:2019-09-01 15:11:20

标签: json angular

我想在Angular项目上运行我的引导程序,但是在angular.json中,我的脚本和样式不起作用

我尝试了从文件夹复制路径,但它给了我错误提示!

 "styles": [
          "C:\AngularCalismalar\intro\node_modules\bootstrap\dist\css\bootstrap.min.css"
        ],
        "scripts": [
            "C:\AngularCalismalar\intro\node_modules\jquery\dist\jquery.min.js",
            "C:\AngularCalismalar\intro\node_modules\bootstrap\dist\js\bootstrap.min.js"
        ]

1 个答案:

答案 0 :(得分:1)

不要使用物理路径,请添加相对路径。

尝试这样:

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