Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 调用角度CSS路径的正确方法_Angular_Angular5 - Fatal编程技术网

Angular 调用角度CSS路径的正确方法

Angular 调用角度CSS路径的正确方法,angular,angular5,Angular,Angular5,我是Angular 5的新手,我想将样式安装到node\u modules文件夹中,该文件夹位于src文件夹之外,因此在.Angular cli.json中,我会这样做: "styles": [ "..node_modules/bootstrap/dist/css/bootstrap.min.css", "..node_modules/font-awesome/css/font-awesome.css", "styles.css" ]

我是Angular 5的新手,我想将样式安装到
node\u modules
文件夹中,该文件夹位于
src
文件夹之外,因此在
.Angular cli.json
中,我会这样做:

 "styles": [
        "..node_modules/bootstrap/dist/css/bootstrap.min.css",
        "..node_modules/font-awesome/css/font-awesome.css",
        "styles.css"
      ],
但我得到:

多线程中的错误 ./src/.node_模块/bootstrap/dist/css/bootstrap.min.css ./src/.node_模块/font-awesome/css/font-awesome.css /src/styles.css模块未找到:错误:无法解析 'C:\Users\User\Documents\Visual Studio 2017\Projects\Tag\Project\Project.WebUI\src..node\u modules\bootstrap\dist\css\bootstrap.min.css' 在“C:\Users\User\Documents\Visual Studio”中 2017\Projects\Tag\Project\Project.WebUI'

这是一个令人困惑的问题,比如编译器没有检测到
,它没有进入proyect路由,这就是为什么它返回
src..node\u modules\

有人能说什么是路由特定文件夹的正确方法吗?问候

结构图:

您已经关闭,文件路径相对于
应用程序
文件夹是正确的,但在文件夹名称之前仍然需要一个斜杠

"styles": [
        "../node_modules/bootstrap/dist/css/bootstrap.min.css",
        "../node_modules/font-awesome/css/font-awesome.css",
        "styles.css"
      ],
:)

编辑:请注意:更改
angular cli.json
将要求您在识别这些更改之前终止并重新运行
ng serve