3、AngularJs的双向数据绑定
来源:互联网 发布:ios游戏推荐 知乎 编辑:程序博客网 时间:2024/04/30 18:32
1、AngularJs的指令系统
• ng-app
• ng-controller
2、AngularJs的双向数据绑定
• MVVM
• $timeout
• ng-click (类似于点击事件)
• ng-model (绑定一个Model的数据)
3、双向数据绑定
3.1 双向数据绑定,M影响V
<!DOCTYPE html><html ng-app><head><meta charset="UTF-8"><title>双向数据绑定</title><script type="text/javascript" src="../js/angular.min.js"></script><script type="text/javascript">function Aaa($scope, $timeout) {$scope.age = 10;/*1、利用定时器*//*$timeout(function() {$scope.age = 5;}, 2000);*//*2、利用点击事件*/$scope.show = function() {$scope.age = 5;}}</script></head><body><div ng-controller="Aaa" ng-click="show()">{{age}}</div></body></html>3.2 双向数据绑定,V影响M
<!DOCTYPE html><html ng-app><head><meta charset="UTF-8"><title>双向数据绑定</title><script type="text/javascript" src="../js/angular.min.js"></script><script type="text/javascript">function Aaa($scope, $timeout) {$scope.name = 'zhang';}</script></head><body><div ng-controller="Aaa"><input type="text" ng-model="name" /><p>{{name}}</p></div></body></html>
1 0
- 3、AngularJs的双向数据绑定
- AngularJS的双向数据绑定
- AngularJS数据的双向绑定
- AngularJS双向数据绑定
- 双向数据绑定---AngularJS的基本原理学习
- 双向数据绑定---AngularJS的基本原理学习
- angularJs的双向数据绑定,简单实用
- 双向数据绑定---AngularJS的基本原理学习
- AngularJS数据双向绑定揭秘
- AngularJS 数据双向绑定揭秘
- AngularJS 数据双向绑定揭秘
- 【AngularJs】Angular双向数据绑定
- angularjs双向数据绑定原理
- angularJs单向/双向数据绑定
- AngularJS双向数据绑定案例
- 【AngularJS】数据绑定(双向绑定)
- AngularJS的数据双向绑定是怎么实现的?
- 双向数据绑定—AngularJS的基本原理学习
- 动态hash算法实现
- cocosx2d_x 贪吃蛇算法
- 编写一个程序,将d:\java目录下的所有.java文件复制到d:\jad目录下,并将原来文件的扩展名从.java改为.jad
- WordPress系列-开场白
- 3Sum 找出数组中的三元组,满足三元组之和为0
- 3、AngularJs的双向数据绑定
- 史上最奇葩的5种编程语言,有的甚至模拟奶牛
- shared pool 相关latch出现异常等待,影响系统性能
- mulesoft 浅谈
- M--二分查找
- DOM编程艺术(节点操作)
- Dima and Guards
- FindJpg(4)-列表的卡顿优化和RecyclerView的简单使用
- 第十六周--阅读程序