AngularJs
2016-04-24 18:16
573 查看
(1)知识库
http://lib.csdn.net/node/391 https://github.com/jikexueyuanwiki/angularjs-guide https://docs.angularjs.org/api/ http://docs.ngnice.com/guide/bootstrap
(2)参考示例 https://github.com/monw3c/angularjs_pingan https://github.com/atian25/wandoujia-satan https://github.com/doggy8088/ng-kp-api-sample
(3)语法糖
https://www.cheatography.com/proloser/cheat-sheets/angularjs/ (4)学习笔记 http://www.360doc.com/content/14/0207/17/203871_350503283.shtml https://github.com/wangmeijian/AngularJS-controller-directive-filter-service http://www.cnblogs.com/lvdabao/p/mean-techstack-angular.html http://www.cnblogs.com/lvdabao/articles/4657235.html http://www.cnblogs.com/leejersey/p/4543998.html http://www.cnblogs.com/wolf-sun/p/4621854.html http://www.cnblogs.com/darrenji/p/4982480.html http://my.oschina.net/blogshi/blog/280400 http://www.cnblogs.com/obeing/p/5215140.html http://my.oschina.net/u/2395167/blog/520532?p={{totalPage}}
参数:
self:新函数的上下文对象
fn:需要绑定的函数
args:传递给函数的参数
返回值:this指向self的新函数
注意:bind会根据你的参数类型来决定调用call或apply,所以args可以是一个个数据,也可以是一个数组哦。
参数:
source:源对象
destination:拷贝的对象
返回值:拷贝的对象
参数:
o1:比较的对象
o2:比较的对象
返回值:boolean
参数:
dst:拓展的对象
src:源对象
返回值:拓展的对象
参数:
obj:对象
iterator:迭代函数
context:迭代函数中上下文
返回值:obj
参数:
string:字符串
返回值:json对象
参数:
json:json
pretty:boolean number 控制字符串输出格式
返回值:字符串
参数:
value:参数
返回值:第一个参数
参数:
value:数据
返回值:boolean
参数:
value:数据
返回值:boolean
参数:
value:数据
返回值:boolean
参数:
value:数据
返回值:boolean
参数:
value:数据
返回值:boolean
参数:
value:数据
返回值:boolean
参数:
value:数据
返回值:boolean
参数:
value:数据
返回值:boolean
参数:
string:字符串
返回值:改变后的新字符串
参数:
string:字符串
返回值:改变后的新字符串
http://lib.csdn.net/node/391 https://github.com/jikexueyuanwiki/angularjs-guide https://docs.angularjs.org/api/ http://docs.ngnice.com/guide/bootstrap
(2)参考示例 https://github.com/monw3c/angularjs_pingan https://github.com/atian25/wandoujia-satan https://github.com/doggy8088/ng-kp-api-sample
(3)语法糖
https://www.cheatography.com/proloser/cheat-sheets/angularjs/ (4)学习笔记 http://www.360doc.com/content/14/0207/17/203871_350503283.shtml https://github.com/wangmeijian/AngularJS-controller-directive-filter-service http://www.cnblogs.com/lvdabao/p/mean-techstack-angular.html http://www.cnblogs.com/lvdabao/articles/4657235.html http://www.cnblogs.com/leejersey/p/4543998.html http://www.cnblogs.com/wolf-sun/p/4621854.html http://www.cnblogs.com/darrenji/p/4982480.html http://my.oschina.net/blogshi/blog/280400 http://www.cnblogs.com/obeing/p/5215140.html http://my.oschina.net/u/2395167/blog/520532?p={{totalPage}}
angular.bind(self, fn, args)
作用:返回一个新的函数,绑定这个函数的this指向self参数:
self:新函数的上下文对象
fn:需要绑定的函数
args:传递给函数的参数
返回值:this指向self的新函数
var obj = { name: 'xxx', print: function (country) { console.log(this.name + ' is form ' + country); } }; var self = { name: 'yyy' }; var bindFn = angular.bind(self, obj.print, 'China'); //var bindFn = angular.bind(self, obj.print, ['China']); obj.print('American'); //$ xxx is form American bindFn(); //$ yyy is form China
注意:bind会根据你的参数类型来决定调用call或apply,所以args可以是一个个数据,也可以是一个数组哦。
angular.copy(source, [destination])
作用:对象的深拷贝参数:
source:源对象
destination:拷贝的对象
返回值:拷贝的对象
var obj = { name: 'xxx', age: 50 }; var copyObj = angular.copy(obj); console.log(copyObj); //$ Object {name: "xxx", age: 50}
angular.equals(o1, o2)
作用:正常比较和对象的深比较参数:
o1:比较的对象
o2:比较的对象
返回值:boolean
angular.equals(3, 3); //$ true angular.equals(NaN,NaN); //$ true angular.equals({name:'xxx'},{name:'xxx'}); //$ true angular.equals({name:'xxx'},{name:'yyy'}); //$ false
angular.extend(dst, src)
作用:对象的拓展参数:
dst:拓展的对象
src:源对象
返回值:拓展的对象
var dst = {name: 'xxx', country: 'China'}; var src = {name: 'yyy', age: 10}; angular.extend(dst, src); console.log(src); //$ Object {name: "yyy", age: 10} console.log(dst); //$ Object {name: "yyy", country: "China", age: 10}
angular.forEach(obj, iterator, [context])
作用:对象的遍历参数:
obj:对象
iterator:迭代函数
context:迭代函数中上下文
返回值:obj
var obj = {name: 'xxx', country: 'China'}; angular.forEach(obj, function (value, key) { console.log(key + ':' + value); }); //$ name:xxx //$ country:China var array = ['xxx', 'yyy']; angular.forEach(array, function (item, index) { console.log(index + ':' + item + ' form ' + this.country); }, obj); //$ 0:xxx form China //$ 1:yyy form China
angular.fromJson(string)
作用:字符串转json对象参数:
string:字符串
返回值:json对象
var json = angular.fromJson('{"name":"xxx","age":34}'); console.log(json); //$ Object {name: "xxx", age: 34}
angular.toJson(json,pretty)
作用:json对象转字符串参数:
json:json
pretty:boolean number 控制字符串输出格式
返回值:字符串
angular.toJson({name:'xxx'}); //$ "{"name":"xxx"}" angular.toJson({name:'xxx'},true); //$ "{ //$ "name": "xxx" //$ }" angular.toJson({name:'xxx'},10); //$ "{ //$ "name": "xxx" //$ }"
angular.identity(value)
作用:返回这个函数的第一个参数参数:
value:参数
返回值:第一个参数
console.log(angular.identity('xxx','yyy')); //$ xxx
angular.isArray(value)
作用:判断一个数据是否是数组参数:
value:数据
返回值:boolean
angular.isArray(3); //$ false angular.isArray([]); //$ true angular.isArray([1, 2, 3]); //$ true angular.isArray({name: 'xxx'}); //$ false
angular.isDate(value)
作用:判断一个数据是否是Date类型参数:
value:数据
返回值:boolean
angular.isDate('2012-12-02'); //$ false angular.isDate(new Date()); //$ true
angular.isDefined(value)
作用:判断一个数据是否是defined类型参数:
value:数据
返回值:boolean
angular.isDefined(undefined) //$ false angular.isDefined([]); //$ true
angular.isUndefined(value)
作用:判断一个数据是否是undefined类型参数:
value:数据
返回值:boolean
angular.isUndefined(undefined) //$ true angular.isUndefined([]); //$ false
angular.isFunction(value)
作用:判断一个数据是否是函数参数:
value:数据
返回值:boolean
angular.isFunction(function(){}); //$ true angular.isFunction(3); //$ false
angular.isNumber(value)
作用:判断一个数据是否是Number类型参数:
value:数据
返回值:boolean
angular.isNumber(4); //$ true angular.isNumber('xxx'); //$ false angular.isNumber(new Number(4)); //$ false angular.isNumber(Number(4)); //$ true
angular.isObject(value)
作用:判断一个数据是否是对象参数:
value:数据
返回值:boolean
angular.isObject('xxx'); //$ false angular.isObject(null); //$ false angular.isObject([]); //$ true angular.isObject(function(){}); //$ false angular.isObject({name:'xxx'}); //$ true
angular.isString(value)
作用:判断一个数据是否是字符串参数:
value:数据
返回值:boolean
angular.isString(4); //$ false angular.isString('xxx'); //$ true angular.isString(new String('xxx')); //$ false angular.isString(String('xxx')); //$ true
angular.lowercase(string)
作用:将字符串大写字母变小写参数:
string:字符串
返回值:改变后的新字符串
var newString = angular.lowercase('XXyyZZ'); console.log(newString); //$ xxyyzz
angular.uppercase(string)
作用:将字符串小写字母变大写参数:
string:字符串
返回值:改变后的新字符串
var newString = angular.uppercase('XXyyZZ'); console.log(newString); //$ XXYYZZ
angular.noop()
作用:空函数var flag = false; flag ? console.log('xxx') : angular.noop();
相关文章推荐
- angular购物车
- ionic+angularjs+cordova混合开发学习之路(前言)
- AngularJS》5个实例详解Directive(指令)机制
- [置顶] 跟我学AngularJs:Directive指令用法解读(下)
- [置顶] 跟我学AngularJs:Directive指令用法解读(上)
- 跟我学AngularJs:AngularJs内置指令大全
- angular watch
- angularjs 20160421
- angular directive指令相互独立
- AngularJS系列:表单全解(表单验证,radio必选,三级联动,check绑定,form提交验证)
- angular directive指令的复用
- AngularJS(0)——AngularJS环境搭建及基本概念
- Angular2(Beta)入门
- AngularJS 指令
- AngularJS 指令
- AngularJS 指令
- Part 16 ng include directive in AngularJS
- Part 15 AngularJS ng init directive
- 使用angularjs ui-bootstrap遇到的问题
- django_restframework_angularjs