30.angularJS第一个实例
2024-09-01 20:19:31
转自: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。
最新文章
- shell正则表达式
- GRUB、MBR名词解释
- js实现倒计时效果
- CentOS6 vsftpd 安装及优化方法
- PDF 补丁丁 0.4.1 版:新增嵌入中文字库、替换文档字库的功能
- zboot/xtract.c
- mysql alter的常用用法
- bgycoding
- 【Android - 基础】之PopupWindow的使用
- mysql常用的命令大全
- sql解释执行顺序
- shell语法简单介绍
- NodeJS - Express4.0错误:Cannot read property &;amp;#39;Store&;amp;#39; of undefined
- STM32固件库文件分析
- ArcGIS JavaScriptAPI----- 缓冲区操作
- Confluence 6 数据库问题解除
- python-----函数参数类型
- CGI 和 FastCGI 协议的运行原理
- libnet 库使用(一)
- JQuery日期插件
热门文章
- U盘安装CentOS 7系统
- 紫书 习题 11-4 UVa 1660 (网络流拆点法)
- Visual Studio 2013 无法创建MVC项目,系统找不到指定的文件.(Exception from HRESULT:08x0070002)
- 题解 P3372 【【模板】线段树1 】(zkw)
- 在pycharm中配置Anaconda以及pip源配置
- 洛谷 P2009 跑步
- poj2280--Amphiphilic Carbon Molecules(扫描线+极角排序+转换坐标)
- taglist安装
- 图解时间复杂度O(n)
- [JZOJ4274] [NOIP2015模拟10.28B组] 终章-剑之魂 解题报告(二进制)