教程 > angularjs 教程 > 阅读:31

angularjs 使用include包含文件——迹忆客-ag捕鱼王app官网

使用 angularjs,可以将 html 页面嵌入到 html 页面中。

html 不支持在 html 页面中嵌入 html 页面。要想实现此效果,可以通过以下两种方式

  • 使用 ajax - 进行服务器调用以获取相应的 html 页面并将其设置在 html 控件的 innerhtml 中。
  • 在服务器端包含- jsp、php 和其他 web 端服务器技术可以在动态页面中包含 html 页面。

angularjs 包含

在angularjs中可以使用 ng-include 指令实现页面的包含。

下面我们分别看一下被包含的文件的内容

main.htm

enter first name:
enter last name:
name: {{student.fullname()}}

subjects.htm

subjects:

name marks
{{ subject.name }} {{ subject.marks }}

查看笔记

扫码一下
查看教程更方便
网站地图