AngularJS Include(包含)
本节介绍了 AngularJS Include(包含) 的知识,你将学习如何使用 ng-include 指令。
使用 AngularJS, 你可以在 HTML 中包含 HTML 文件。
在未来的HTML中包含 HTML 文件
在 HTML 中,目前还不支持包含 HTML 文件的功能。
W3C 已经建议 http://www.w3.org 在未来的 HTML 中支持包含HTML的功能,格式如下:
<link rel=”import” href=”/path/navigation.html”>
服务端包含
大部分web服务器支持服务端脚本的包含 (SSI:Server Side Includes)。
使用 SSI, 你可以在HTML页面发送至浏览器前包含 HTML。
PHP 实例
<?php require("navigation.php"); ?>