AngularJS ng-init 指令

AngularJS 教程 · 2019-04-01 18:37:20

AngularJS 实例

初始化应用时创建一个变量:

<div ng-app="" ng-init="myText='Hello World!'">

<h1>{{myText}}</h1>

定义和用法

ng-init 指令执行给定的表达式。

ng-init 指令添加一些不必要的逻辑到 scope 中,建议你可以在控制器中 ng-controller 指令执行它 。

语法

<element ng-init="expression" ></element>

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

参数值

描述
expression 执行的表达式。

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

查看所有标签

The Web Designer's Idea Book

The Web Designer's Idea Book

Patrick Mcneil / How / 2008-10-6 / USD 25.00

The Web Designer's Idea Book includes more than 700 websites arranged thematically, so you can find inspiration for layout, color, style and more. Author Patrick McNeil has cataloged more than 5,000 s......一起来看看 《The Web Designer's Idea Book》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具