gpt4 book ai didi

javascript - 为什么 ng-include 不工作?

转载 作者:行者123 更新时间:2023-11-30 16:19:39 24 4
gpt4 key购买 nike

ng-include 不工作

目录结构如下:

ssh_project
--public
----templates
------header.html
------footer.html
----views
------index.html

现在这是我的 index.html 文件

<body>
<h1>Hello</h1>
<div ng-include='"../templates/header.html"'></div>
<div ng-view></div>
<div ng-include='"../templates/footer.html"'></div>
</body>

最佳答案

您必须先使用双引号,然后使用单引号。试试下面

<body>
<h1>Hello</h1>
<div ng-include="'../templates/header.html'"></div>
<div ng-view></div>
<div ng-include="'../templates/footer.html'"></div>
</body>

关于javascript - 为什么 ng-include 不工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34940583/

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