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 Definitive Guide to MongoDB

The Definitive Guide to MongoDB

Peter Membrey、Wouter Thielen / Apress / 2010-08-26 / USD 44.99

MongoDB, a cross-platform NoSQL database, is the fastest-growing new database in the world. MongoDB provides a rich document orientated structure with dynamic queries that you’ll recognize from RDMBS ......一起来看看 《The Definitive Guide to MongoDB》 这本书的介绍吧!

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

在线压缩/解压 HTML 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具