转自:https://www.cnblogs.com/best/tag/Angular/

AngularJS 通过 ng-directives 扩展了 HTML。

ng-app 指令定义一个 AngularJS 应用程序。

ng-model 指令把元素值(比如输入域的值)绑定到应用程序。

ng-bind 指令把应用程序数据绑定到 HTML 视图。

 <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
</head>
<body> <div ng-app="">
<p>名字 : <input type="text" ng-model="name"></p>
<h1>Hello {{name}}</h1>
</div> </body>
</html>

实例讲解:

当网页加载完毕,AngularJS 自动开启。

ng-app 指令告诉 AngularJS,<div> 元素是 AngularJS 应用程序 的"所有者"。

ng-model 指令把输入域的值绑定到应用程序变量 name

ng-bind 指令把应用程序变量 name 绑定到某个段落的 innerHTML。

最新文章

  1. shell正则表达式
  2. GRUB、MBR名词解释
  3. js实现倒计时效果
  4. CentOS6 vsftpd 安装及优化方法
  5. PDF 补丁丁 0.4.1 版:新增嵌入中文字库、替换文档字库的功能
  6. zboot/xtract.c
  7. mysql alter的常用用法
  8. bgycoding
  9. 【Android - 基础】之PopupWindow的使用
  10. mysql常用的命令大全
  11. sql解释执行顺序
  12. shell语法简单介绍
  13. NodeJS - Express4.0错误:Cannot read property &amp;amp;#39;Store&amp;amp;#39; of undefined
  14. STM32固件库文件分析
  15. ArcGIS JavaScriptAPI----- 缓冲区操作
  16. Confluence 6 数据库问题解除
  17. python-----函数参数类型
  18. CGI 和 FastCGI 协议的运行原理
  19. libnet 库使用(一)
  20. JQuery日期插件

热门文章

  1. U盘安装CentOS 7系统
  2. 紫书 习题 11-4 UVa 1660 (网络流拆点法)
  3. Visual Studio 2013 无法创建MVC项目,系统找不到指定的文件.(Exception from HRESULT:08x0070002)
  4. 题解 P3372 【【模板】线段树1 】(zkw)
  5. 在pycharm中配置Anaconda以及pip源配置
  6. 洛谷 P2009 跑步
  7. poj2280--Amphiphilic Carbon Molecules(扫描线+极角排序+转换坐标)
  8. taglist安装
  9. 图解时间复杂度O(n)
  10. [JZOJ4274] [NOIP2015模拟10.28B组] 终章-剑之魂 解题报告(二进制)