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

查看所有标签

Mobilizing Web Sites

Mobilizing Web Sites

Layon, Kristofer / 2011-12 / 266.00元

Everyone has been talking about the mobile web in recent years, and more of us are browsing the web on smartphones and similar devices than ever before. But most of what we are viewing has not yet bee......一起来看看 《Mobilizing Web Sites》 这本书的介绍吧!

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

Base64 编码/解码

MD5 加密
MD5 加密

MD5 加密工具

SHA 加密
SHA 加密

SHA 加密工具