gpt4 book ai didi

css - 使用单个 Controller 控制两个 Partials 时不加载 Angular css 文件

转载 作者:搜寻专家 更新时间:2023-10-31 23:38:55 25 4
gpt4 key购买 nike

我正在开发基于 MEAN 堆栈的网络应用程序。我使用 bootstrap 作为 css 库,并在我的两个文件“app.css”和“mio.css”中覆盖了一些 css该应用程序工作正常,直到我在处理两个部分的 Controller 中点击 refresh,然后重新加载除了我的 2 个 css 文件之外的所有内容。

<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.1.1/css/font-awesome.min.css" rel="stylesheet">

<link rel="stylesheet" href="css/app.css">
<link rel="stylesheet" href="css/mio.css">

如果我检查它们,它们包含 index.html 数据(head body dcc)

你能告诉我发生了什么事吗??

最佳答案

尝试使用 css 文件的完整文件路径。例如..

<link rel="stylesheet" href="/assets/css/app.css">

问题可能出在服务器端。由于 Angular 应用程序是单页 ajax 应用程序,服务器必须将所有请求重定向到 index.html 页面,除了 Assets 。您的服务器可能会返回 index.html 页面而不是您的 css 文件。

关于css - 使用单个 Controller 控制两个 Partials 时不加载 Angular css 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19554347/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com