繁体   English   中英

为什么ng-include不起作用?

[英]why ng-include not working?

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>

只是小错误。

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

尝试<div ng-include="'../templates/header.html'"></div>因为双引号应该在外面,单引号应该在里面。 请更改并继续。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM