错误GET http:// localhost:4200 / styles.css,但是我可以使用这些样式。这是怎么回事?

FlashBanistan

我在angular 2项目中收到错误,在chrome开发人员工具控制台中,出现一条消息,提示GET http:// localhost:4200 / styles.css,其左侧带有红色的x。我可以使用这些样式,这是怎么回事?

这是我的index.html文件:

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>Scorekeeper</title>
  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
  <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
  <link rel="stylesheet" href="./styles.css">
</head>
<body>
  <app-root>Loading...</app-root>
</body>
</html>

在此处输入图片说明

浮潜

从index.html删除指向样式表的链接。您正在使用angular-cli,在您的配置中,styles.css已包含在angular-cli中。HTML中的链接标记没有任何作用。

(角度cli还在该HTML中动态注入该样式的链接标记,这就是“有效”的原因)。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

GET http:// localhost:4200 / resource 404(未找到)

angular 应用程序适用于 http://localhost:4200,但我想要 https://localhost:44325

GET http://localhost:4200/src/app/ficheros/nacionalidades.json 404(未找到)

使用angular-cli在angular2中获取http:// localhost:4200 / null 404(未找到)

Ember Hello Word-http:// localhost:4200 / tests中的测试错误,但在命令行中没有

GET http:// localhost:4200 / node_modules / zone.js / dist / zone.js 404(未找到)

CORS 策略阻止了对源“http://localhost:4200”的 XMLHttpRequest 的访问

POST http:// localhost:4200 / contact / send 404(未找到)

我正在使用 angular 和 firebase realtime database.pass 数据实现 crud 应用程序,例如 http://localhost:4200/customer/{key value}

從源“http://localhost:4200”訪問“localhost:8088/user/”的 XMLHttpRequest 已被 CORS 策略阻止

我收到错误 GET http://localhost:3000/api/products 404(未找到)

CORS策略已阻止访问源为“ http:// localhost:4200”的“ http:// ....”处的XMLHttpRequest

如何在谷歌浏览器中连接到Angle,Node.js http:// localhost:4200

chrome日志中的“导航到http:// localhost:4200 /”之后的问号是什么意思?

(404未找到)正在加载http:// localhost:4200 / angular2-datatable / datatable

Angular7中的CORS策略已阻止源'http:// localhost:4200'

在 Angular 中获取 http://localhost:4200/[object%20Blob] 404(未找到)

从CORS策略阻止从源“ http:// localhost:4200”访问“ URL”处的XMLHttpRequest:

在組件 service.ts url: "http://localhost:4200/data/products.json" not found

Angular 8:POST http:// localhost:4200 / assets / data / students.json 404(未找到)

SQL错误42803:我不应该收到此错误,这是怎么回事?

我在styles.css中需要gradle Project HTTP 404

这是怎么回事。它向我显示此错误找不到与“ <%”匹配的关闭标签

这是怎么回事 当我尝试运行此代码时,出现以下错误

我无法创建表,这是怎么回事?(语法错误:遇到“(”)

我在试图取笑的命令中遇到 EOF 错误。这是怎么回事?

错误:“无法连接到 *** - getaddrinfo ENOTFOUND”使用带有“http://localhost:9000/Product”的 get 语句的邮递员

使用cURL的HTTP GET提供SSL错误

为什么我不断收到500(内部服务器错误)GET http:// localhost:3000 / favicon.ico 500(内部服务器错误)?