版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年云南省《保密知识竞赛必刷100题》考试题库及参考答案详解(培优)
- 公司人力资源管理流程优化方案
- 六年级下册语文教案-第五组21-我最好的老师-人教新课标
- 2026年县乡教师选调考试《教育学》测试卷及完整答案详解1套
- 2026年县乡教师选调考试《教育学》经典例题附答案详解(夺分金卷)
- 2026年县乡教师选调考试《教育学》题库试题及参考答案详解(综合卷)
- 2026国家民委直属事业单位招聘12人备考题库(北京)及1套完整答案详解
- 2026河南洛阳仁大医院春季招聘23人备考题库含答案详解(巩固)
- 2026年高职(酒店前厅实训)接待实操考核试题及答案
- 2026河南平顶山科技职业学院人才招聘备考题库及一套完整答案详解
- 智能运输系统第12讲-智能交通与物流
- 项目任务活动挖掘有价值客户课时
- 小学二年级《道德与法治》下册教学计划
- 人教A版高中数学选择性必修第二册全册各章节课时练习题含答案解析(第四章数列、第五章一元函数的导数及其应用)
- 2023学年完整公开课版横断面测量
- 医师执业变更执业多机构备案申请审核表
- GB/T 19582.2-2008基于Modbus协议的工业自动化网络规范第2部分:Modbus协议在串行链路上的实现指南
- 带状疱疹针灸治疗学课件
- 厂用电设备安装方案
- 行业会计比较ppt课件(完整版)
- 定量检验性能评价要求与实验方案设计-中山市人民医院
评论
0/150
提交评论