AngularJS bind
闲着无聊怕手生 小练习
<!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 ng-app="">
<div> AngularJs bing</div>
<script>
var self = {name:'boyi'};
var f = angular.bind(self,function(age){
alert(this.name+' is '+age+'!');
},
'15');
f();
var m = angular.bind(self,function(age){
alert(this.name+' is '+age+'!');
});
m(3);
</script>
</body>
</html>
AngularJS bind的更多相关文章
- angularjs bind与model配合双向绑定 表达式方法输出
<!doctype html><html lang="en"><head> <meta charset="UTF-8" ...
- 深入理解 AngularJS 的 Scope
JavaScript 的原型继承就是奇葩. 之前在 V2EX 上看到讨论说,不会 OOP 的 JavaScript 的程序员就是野生程序员.看来我是属于野生的. 一.遇到的问题 问题发生在使用 A ...
- 理解AngularJS的作用域Scope
AngularJS中,子作用域一般都会通过JavaScript原型继承机制继承其父作用域的属性和方法.但有一个例外:在directive中使用scope: { ... },这种方式创建的作用域是一个独 ...
- 深入理解 AngularJS 的 Scope(转)
一.遇到的问题 问题发生在使用 AngularJS 嵌套 Controller 的时候.因为每个 Controller 都有它对应的 Scope(相当于作用域.控制范围),所以 Controller ...
- 转: 深入理解 AngularJS 的 Scope
查看 DEMO.参考 StackOverflow. ng-switch ng-switch 的原型继承和 ng-include 一样.所以如果你需要对基本类型数据进行双向绑定,使用 $parent ...
- angularJS 系列(一)
angularJS 中 $scope 的原型 和 原型继承之间的细微差别是什么? 参考:http://stackoverflow.com/questions/14049480/what-are-the ...
- 转深入理解 AngularJS 的 Scope作用域
文章转载英文:what-are-the-nuances-of-scope-prototypal-prototypical-inheritance-in-angularjs 中文:http://www. ...
- angularjs 中的scope继承关系——(2)
转自:http://www.lovelucy.info/understanding-scopes-in-angularjs.html angularjs 中的scope继承关系 ng-include ...
- 夺命雷公狗—angularjs—22—bind改指向和传参方式
在angularjs中的传参的jquery的方式是极度相似的噢,而且还可以通过bind来改变指向 <!DOCTYPE html> <html lang="en" ...
随机推荐
- ZK框架笔记4、通用组件、页面、桌面
组件(component)是一种用户接口(UI)对象,如一个标签.按钮.树. 页面(page)是一个组件的集合. 桌面(desktop)是一个包含相同URL请求的页面. ...
- ubuntu错误解决E: Sub-process /usr/bin/dpkg returned an error code (1)
在用apt-get安装软件时出现了类似于 install-info: No dir file specified; try –help for more information.dpkg:处理 get ...
- 【小程序】微信小程序开发—弹出框
1. <span style="font-family:Comic Sans MS;font-size:18px;color:#333333;"><view cl ...
- Linux间的进程通信;以及子进程的创建
"-----第六天-----------------------------------------------------------------------------" .版 ...
- Editplus 文件中批量搜索字符串的技巧
常规情况下,我们利用Crtl+F可以在文档中查找字符串,进行替换等操作. 但要有的时候,我们要在大量文件中做这种查找操作,显然,一个个的打开文档是不现实的. 比如: 最近,谷歌被墙的很厉害,导致很多w ...
- Lintcode---统计比给定整数小的数的个数
给定一个整数数组 (下标由 0 到 n-1,其中 n 表示数组的规模,数值范围由 0 到 10000),以及一个 查询列表.对于每一个查询,将会给你一个整数,请你返回该数组中小于给定整数的元素的数量. ...
- python 配置
一.下载 https://www.python.org/ftp/python/3.4.2/python-3.4.2.amd64.msi 二.配置python--eclipse插件 1.直接在eclip ...
- ML中Boosting和Bagging的比較
说到ML中Boosting和Bagging,他们属于的是ML中的集成学习,集成学习法(Ensemble Learning) ① 将多个分类方法聚集在一起.以提高分类的准确率. (这些算法能够是不同的 ...
- EularProject 32: 数字1-9排列构成乘法等式
Pandigital products Problem 32 We shall say that an n-digit number is pandigital if it makes use of ...
- [MySQL] Innodb參数优化
innodb_buffer_pool_size innodb_buffer_pool_size 參数用来设置Innodb 最基本的Buffer(Innodb_Buffer_Pool)的大小,也就是缓存 ...