AngularJS ng-include 指令

AngularJS 教程 · 2019-04-01 18:18:19

AngularJS 实例

包含 HTML 文件:

<div ng-include="'myFile.htm'"></div>

定义和用法

ng-include 指令用于包含外部的 HTML 文件。

包含的内容将作为指定元素的子节点。

ng-include 属性的值可以是一个表达式,返回一个文件名。

默认情况下,包含的文件需要包含在同一个域名下。

语法

<element ng-include="filename" onload="expression" autoscroll="expression" ></element>

ng-include 指令作为元素使用:

<ng-include src="filename" onload="expression" autoscroll="expression" ></ng-include>

所有的 HTML 元素都支持该指令。

参数值

描述
filename 文件名,可以使用表达式来返回文件名。
onload 可选, 文件载入后执行的表达式。
autoscroll 可选,包含的部分是否在指定视图上可滚动。

点击查看所有 AngularJS 教程 文章: https://codercto.com/courses/l/36.html

查看所有标签

Non-Obvious

Non-Obvious

Rohit Bhargava / Ideapress Publishing / 2015-3-29 / USD 24.95

What do Disney, Bollywood, and The Batkid teach us about how to create celebrity experiences for our audiences? How can a vending-machine inspire world peace? Can being imperfect make your business mo......一起来看看 《Non-Obvious》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码