第六讲 angularjs 事件指令 相关指令 和样式指令 dom操作指令详解_W_第1页
第六讲 angularjs 事件指令 相关指令 和样式指令 dom操作指令详解_W_第2页
第六讲 angularjs 事件指令 相关指令 和样式指令 dom操作指令详解_W_第3页
第六讲 angularjs 事件指令 相关指令 和样式指令 dom操作指令详解_W_第4页
第六讲 angularjs 事件指令 相关指令 和样式指令 dom操作指令详解_W_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、第六讲 Angularjs 指令 input 相关指令 和样式指令 DOM 操作指令详解 学习要点: 1. AngularJs 指令 2. input 相关指令 3. 样式指令 4. DOM 操作指令 5. ngBind/ngBindHtml/ngBindTemplate重点 6. ng-initng-modeng-model-options ng-controler主讲教师:(树根) 合作网站: (PhoneGap 中文网) 合作网站: (IT 营)1. Angularjs 指令自己研究: ng-click/dbclickng

2、-mousedown/up ng-mouseenter/leaveng-mousemove/over/out ng-keydown/up/pressng-focus/blur ng-submit重点讲述: ng-selected ng-change ng-copyng-cut ng-pasteng-cloak在 angular 中为我们提供了 ng-cloak 来实现纺织闪烁的方案,我们只需要在需要的地方加上 ng-cloak。同时对于 bing 文字( express )我们也可以改为 ng-bind 来实现避免。 ng-non-bindable 如果我们就想要一个 这样的内容就可以使用 n

3、g-clock1111122222bbbccc2. Angularjsinput 相关指令ng-disabled ng-readonly ng-checked ng-value无标题文档var app = angular.module(myApp,);app.controller(firstController,$scope,$interval,function($scope,$interval) va r iNow = 5;$scope.text = iNow+秒;$scope.isDisabled = true;/setInterval - $scope.$apply()/$timeout

4、$intervalvar timer =$interval(function() iNow-;$scope.text = iNow+秒;if(iNow = 0)$interval.cancel(timer);$scope.text = 可以点击啦;$scope.isDisabled = false;,1000););3. Angularjs样式指令ng-class ng-style ng-href ng-srcng-attr-(suffix)html 中属性可能有多了 angularjs 提供了一种通用的写法如:ng-attr- href无标题文档.red background:red;.ye

5、llow background:yellow;var m1 = angular.module(myApp,); m1.controller(Aaa,$scope,function($scope)$scope.text = hello;$scope.style = color:red,background:yellow;$scope.sClass = red:true,yellow:true;$scope.url = ;);texttexttexttextaaaaaaaaaaaaaa/alert(1);4. AngularjsDOM 操作指令ng-showd

6、isplay 隐藏显示 aaaaaaaaaaaang-ifdom 操作 aaaaaaaaaaaang-switch默认的效果切换的效果ng-openCopyright 2011.All pages and graphics on this web site are the property ofW3School.5. AngularjsngBind/ngBindHtml/ngBindTemplate/ ngIncludengBind显示数据类似于 ngBindTemplate解决 ng-bind 中只能绑定一个的问题 ngBindHtml解析 html 代码 ngInclude加载外部页面 a

7、ngular.module(initExample, )6. ng-initng-modeng-model-optionsng-controler ng-init.controller(ExampleController, $scope, function($scope)$scope.list = a, b, c, d;);list outerIndex innerIndex =value;ng-mode无标题文档.red background:red;.yellow background:yellow;/*var m1 = angular.module(myApp,); m1.control

8、ler(Aaa,$scope,function($scope)$scope.text = hello;);*/var m1 = angular.module(myApp,); m1.controller(Aaa,$scope,FnAaa);function FnAaa($scope)FnAtotype.num = 123; FnAtotype.text = hello; FnAtotype.show = function()return angularJS;!-text-a1.text:a1.show()ng-model-options控制双向 绑定的时候 触发的方式 Name:Othe

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论