[AngularJS] Angular 1.3: ng-model-options updateOn, debounce
<!DOCTYPE html>
<html ng-app="app">
<head lang="en" >
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>AngularJS 1.3 ng-model-options</title>
</head>
<body ng-controller="MainCtrl as vm"> <form name="myForm" novalidate>
<label>
Some input:
<input
type="text"
name="myField"
ng-model="vm.inputValue"
ng-model-options="vm.modelOptions"
required /> </label>
<button type="submit">Submit</button>
</form> Bound value: <span ng-bind="vm.inputValue"></span> <br />
Field Error State: <pre>{{myForm.myField.$error | json}}</pre> <br />
Form Error State: <pre>{{myForm.$error | json}}</pre>
myForm.$submitted: {{myForm.$submitted}} <script src="bower_components/angular/angular.min.js"></script>
<script src="app.js"></script>
</body>
</html>
/**
* Created by Answer1215 on 11/13/2014.
*/ function MainCtrl(){
var vm = this; vm.inputValue = "";
vm.modelOptions = {
updateOn: 'default blur',
debounce: {
default: 1200, //for search we don't want to update server during user type
blur: 0 //when user move on to the next field, we update immedately
}
};
} angular
.module('app', [])
.controller('MainCtrl', MainCtrl);
Read More: https://egghead.io/lessons/angularjs-new-in-angular-1-3-ng-model-options-updateon-and-debounce
[AngularJS] Angular 1.3: ng-model-options updateOn, debounce的更多相关文章
- AngularJs学习笔记--Understanding the Model Component
原版地址:http://docs.angularjs.org/guide/dev_guide.mvc.understanding_model 在angular文档讨论的上下文中,术语“model”可以 ...
- Angularjs 学习笔记-2017-02-05-初识Angular及app、model、controller、repeat指令和fileter、orderBy
ng-app 定义作用域,从作用域处开始执行ng命令指令 ng-model 数据绑定字符,用于双向数据绑定 ng-controller ng控制台,定义function name($scope)来 ...
- angularjs中常用的ng指令介绍【转载】
原文:http://www.cnblogs.com/lvdabao/p/3379659.html 一.模板中可使用的东西及表达式 模板中可以使用的东西包括以下四种: 指令(directive).ng提 ...
- [AngularJS] Angular 1.3 ngMessages with ngAnimate
Note: Can use $dirty to check whether user has intracted with the form: https://docs.angularjs.org/a ...
- [AngularJS] Angular 1.3 $submitted for Form in Angular
AngularJS 1.3 add $submitted for form, so you can use $submitted to track whether the submit event ...
- [AngularJS] Angular 1.3 ng-model-options - getterSetter
getterSetter: boolean value which determines whether or not to treat functions bound to ngModel as ...
- AngularJs angular.element
angular.element 将DOM元素或者HTML字符串一包装成一个jQuery元素. 格式:angular.element(element); element:包装成jquery对象的html ...
- AngularJs angular.bind、angular.bootstrap、angular.copy
angular.bind 返回一个调用self的函数fn(self代表fn里的this).可以给fn提供参数args(*).这个功能也被称为局部操作,以区别功能. 格式:angular.bind(se ...
- [Angularjs]angular ng-repeat与js特效加载先后导致的问题
写在前面 最近在项目中遇到这样的一个前端的bug,在ng-repeat中绑定的图片,有一个晃动的特效,在手机端浏览的时候,图片有时候会正常展示,有时就展示不出来.当时猜测是因为angularjs与特效 ...
随机推荐
- Docker应用系列(五)| 构建Mongodb服务器
本示例基于Centos 7,假设目前使用的账号为release,拥有sudo权限. 由于Docker官方镜像下载较慢,可以开启阿里云的Docker镜像下载加速器,可参考此文进行配置. 主机上服务安装步 ...
- eclipse 的alt shift a,r 这个快捷键怎么操作 怎么按 eclipse 快捷键 逗号 什么意思
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha eclipse 的alt shift a,r 这个快捷键怎么操作 怎么按 eclipse ...
- 安卓 onTouch OnTouchEvent onChick 顺序
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha 分发触摸事件 -> 在 触摸 时候 -> 在触摸事件时候->在点击时候 ...
- 51nod1437 迈克步 单调栈
考虑一个点作为最小值的区间$[L[i], R[i]]$ 那么这个区间的所有含$i$的子区间最小值都是$v[i]$ 因此,用单调栈求出$L[i], R[i]$后,对$R[i] - L[i] + 1$这个 ...
- Apache之.htaccess备忘录(一)
.htaccess文件是Apache服务器中的一个配置文件,它负责相关目录下的网页配置,也是使用apache的同学最常碰到的文件,下面罗列一些常用的知识,以备不时之需. 1 . 如何让Apache支持 ...
- 实用在线小工具 -- JS代码压缩工具
实用在线小工具 -- JS代码压缩工具 将JS代码进行压缩可以减少内存占用,下面链接是一个在线JS代码压缩工具,它将多余的空格和换行符压缩了. JS代码压缩工具链接:http://jspack ...
- [转]String.Replace 和 String.ReplaceAll 的区别
JAVA 中的 replace replaceAll 问题: 测试code System.out.println("1234567890abcdef -----> "+&qu ...
- 2015 UESTC 数据结构专题E题 秋实大哥与家 线段树扫描线求矩形面积交
E - 秋实大哥与家 Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/contest/show/59 De ...
- 2015 UESTC 搜索专题A题 王之迷宫 三维bfs
A - 王之迷宫 Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/contest/show/61 Des ...
- mysql存储过程导入表
运用存储过程,把用户表一数据导入用户表二 DELIMITER @@ CREATE PROCEDURE imp_to_user2() BEGIN – 声明一个标志done, 用来判断游标是否遍历完成 D ...