刚学angular, 做一些笔记方便自己翻看.ng-app: 填写模块的名称ng-init: 初始化数据(一般通过控制器初始化)ng-model: 填写数据模型ng-bind: 绑定数据模型, 用于展示数据ng-controller: 控制器, 用于存储数据,改变数据等ng-disabled:绑定应...
分类:
Web程序 时间:
2015-08-12 16:35:04
阅读次数:
124
用angularjs在循环遍历中绑定ng-modelCSDN博客 原文 http://blog.csdn.net/chen2991101/article/details/19764263 angularjs的双向绑定非常的好用,当修改了一个地方的值后另外一个地方也同步修改了,如果用平时的js...
分类:
Web程序 时间:
2015-08-06 21:47:16
阅读次数:
271
AngularJS双向数据绑定ng-model与ng-bind指令这两个指令是实现双向数据绑定的最主要的指令,区别如下:
ng-bind has one-way data binding ($scope –> view). It has a shortcut {{ val }} which displays the scope value $scope.val inserted into htm...
分类:
Web程序 时间:
2015-07-27 23:14:55
阅读次数:
395
1》ng-if 导致 ng-model 失效的问题 比如说下拉联动隐藏显示的时候,多个验证模块,需要使用到ng-if。可以使用 $parent 来解决这个问题 ng-model="$parent.userName" ; 如果存在 ng-if 的嵌套情况,$parent.$parent 逐级嵌套$.....
分类:
其他好文 时间:
2015-07-25 18:23:10
阅读次数:
161
.directive("contenteditable",?function(){
??return?{
????restrict:?"A",
????require:?"ngModel",
????link:?function(scope,?element,?attrs,?ngModel)?{
??????function?rea...
分类:
其他好文 时间:
2015-07-22 19:10:22
阅读次数:
114
ng-model将表单控件和当前作用域的属性进行绑定代码如下:{{someModel.someProperty}}ng-init该指令被调用时会初始化内部作用域。这个指令一般会出现在比较小的应用中,比如给个demo什么的...代码如下: I'm a/an {{job}}除了ng-init,我们还有更...
分类:
Web程序 时间:
2015-07-20 06:46:46
阅读次数:
154
调用嵌套scope的时候,不要直接绑定input到scope的成员 <input?ng-model="name"?/>?<!--?NO?--> 绑定到更深的级别 <input?ng-model="form.name"?/>?<!--?YES?--> 这是因为scope的原型基础自父scope。因...
分类:
其他好文 时间:
2015-07-17 19:10:32
阅读次数:
126
学习地址http://www.yiibai.com/angularjs/angularjs_environment.htmlhttp://docs.angularjs.cn/api/ng/filter/filter 指令集合 ng-app:设定作用域ng-model:设定模型变量ng-contro....
分类:
Web程序 时间:
2015-07-17 18:40:28
阅读次数:
136
ng-model是AngularJS的原生指令,通过require:‘ngModel‘可以更加深入地处理数据的双向数据绑定。ng-model里面的属性有:$parsers:保存了从viewValue到modelValue绑定过程中的处理函数。$formatters:保存了从modelValue到viewValue绑定过程中的处理函数。$setViewValue:当Ang..
分类:
其他好文 时间:
2015-07-09 14:47:00
阅读次数:
99
最近使用angular日期选取器。只需要把所选的输出迄今input输入框,根据默认的假设,显示是在时间的形式的时间戳。不符合规定。需要格成一个特定的公式格公式。但input上ng-model不能直接对用于filter。因此内容需要一种方法来在这里显示格式化。网上寻找解决方式就是写个directive...
分类:
其他好文 时间:
2015-07-01 20:17:35
阅读次数:
432