![](/img/trans.png)
[英]Angular JS $scope from Partials not working in index.html
[英]Angular build index.html not working
找不到您的文件,因为基本 URL 已更改。
您可以通过在index.html
使用<base href="./">
来解决此问题。
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
您还可以使用ng build --base-href ./
命令,这样就不需要修改 HTML 文件。
根据 Mozilla 的说法:
The HTML <base> element specifies the base URL to use for
all relative URLs in a document. There can be only one <base> element in a document.
这意味着所有已编译的资源都相对于系统的根目录进行引用。 例如,样式和图像与 index.html 位于同一文件夹中。 使基本 url <base href="/">
或<base href="foldername of the index.html">
使其引用当前文件夹。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.