5

这篇文章 详细介绍了如何在事件上绑定加载模板部分。

但是,如果我想在页面加载时将模板部分加载到像 Smarty 这样的模板引擎中呢?

例如在 Smarty 中:

<html>
<body>
{include file="templates/header.html"}
<span>Dude, this has too be possible in Angular JS...</span>
{include file="templates/footer.html"}
</body>
</html>
4

1 回答 1

9

您可以使用 ngInclude 指令。可以在此处找到文档和示例:http://docs.angularjs.org/api/ng.directive: ngInclude

于 2012-12-28T16:26:03.787 回答