<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script type="text/javascript" src="angular.min.js"></script><style>.red{ background:red; color:blue;}.yellow{ background:yellow;}</style></head><body><div ng-app="myApp"><div ng-controller="firstController"><div ng-cloak  ng-class="{red:s}">{{text}}</div><div ng-cloak  ng-class="{{sClass}}">{{text}}</div><div ng-cloak  ng-style="{color:'red'}">{{text}}</div><div ng-cloak  ng-style="{{style}}">{{text}}</div><a href="{{url}}">百度1</a><a ng-href="{{url}}">百度</a><img src="{{src}}" /><img ng-src="{{src}}" /><br><br><a ng-href="{{url}}" ng-attr-title="{{text}}">百度</a><br><br><div ng-show="s">你好</div> //dispaly显示隐藏<br><br><div ng-if="s">你好</div> //dom的移除和没有移除<div ng-switch on="s"><p ng-switch-default>默认的效果</p><p ng-switch-when="false">false切换的效果</p><p ng-switch-when="true">true切换的效果</p></div><br><br><div class="animate-switch-container"ng-switch on="selection"><div class="animate-switch" ng-switch-when="settings">Settings Div</div><div class="animate-switch" ng-switch-when="home">Home Span</div><div class="animate-switch" ng-switch-default>default</div></div><input type="checkbox" ng-model="open"><br/><details id="details" ng-open="open"><summary>Copyright 2011.</summary><p>All pages and graphics on this web site are the property of W3School.</p></details></div></div><script type="text/javascript">var app = angular.module("myApp", []);app.controller('firstController',function($scope){$scope.text='phonegap中文网';$scope.s=true;$scope.sClass = "{red:true,yellow:true}";$scope.style = "{color:'red',background:'yellow'}";$scope.url='http://www.baidu.com';$scope.src='http://www.baidu.com/img/bdlogo.png';
//              $scope.style = "{color:'red',background:'yellow'}";
//              $scope.sClass = "{red:true,yellow:true}";
//              $scope.url = "http://www.baidu.com";
              $scope.items = ['settings', 'home', 'other'];$scope.selection = $scope.items[0];});</script></body>
</html>

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script type="text/javascript" src="angular.min.js"></script><script type="text/javascript" src="http://cdn.bootcss.com/angular.js/1.4.0-beta.6/angular-sanitize.min.js"></script></head><body><div ng-app="myApp"><div ng-controller="firstController"><div ng-click="run()">点击</div><div ng-bind="text"></div>//绑定多个<div ng-bind-template="{{text}} {{name}}"></div>//1.引入angular-sanitize,2.依赖['ngSanitize']<div ng-bind-html="text2"></div></div></div><script type="text/javascript">var app = angular.module("myApp", ['ngSanitize']);app.controller('firstController',function($scope){$scope.text='phonegap中文网';$scope.name='中文网';$scope.text2='<h2>这是h2</h2>';$scope.run=function(){alert('run');console.log('run');}});</script></body>
</html>

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script type="text/javascript" src="../angular.min.js"></script><script type="text/javascript" src="http://cdn.bootcss.com/angular.js/1.4.0-beta.6/angular-sanitize.min.js"></script></head><body><div ng-app="myApp"><div ng-controller="firstController"><div ng-repeat="innerList in list" ng-init="outerIndex = $index"><div ng-repeat="value in innerList" ng-init="innerIndex = $index"><span class="example-init">list[ {{outerIndex}} ][ {{innerIndex}} ] = {{value}};</span></div></div><input type="text" ng-model="name" ng-model-options="{ updateOn: 'blur' }" />{{name}}</div></div><script type="text/javascript">var app = angular.module("myApp", ['ngSanitize']);app.controller('firstController',function($scope){$scope.list = [['a', 'b'], ['c', 'd']];});</script></body>
</html>

转载于:https://www.cnblogs.com/yaowen/p/7225388.html

angularjs1-5,class,相关推荐

  1. springboot中接口实例化_AngularJs中控制器的定义,实例化,作用域范围

    AngularJs中控制器的定义,实例化,作用域范围 基于AngularJS入门与进阶(江荣波 著)这本书的笔记 AngularJS 1.x的demo AngularJS1.x和Angular2,4, ...

  2. Mysql,SqlServer,Oracle主键自动增长的设置

    Mysql,SqlServer,Oracle主键自动增长的设置 参考文献 http://blog.csdn.net/andyelvis/article/details/2446865 1.把主键定义为 ...

  3. linux启动,重启,停止 jar,.sh脚本

    linux启动,重启,停止 jar,.sh脚本 #配置jar名称 APP_NAME=receiver.jar#使用说明,用来提示输入参数 usage() { echo "Usage: sh ...

  4. 堆栈,数据,文本,heap,bss,text data,stack

    堆栈,数据,文本,heap,bss,text data,stack text data bss stack heap 段 根据APUE,程序分为下面的段:.text, data (initialize ...

  5. TVM示例展示 README.md,Makefile,CMakeLists.txt

    TVM示例展示 README.md,Makefile,CMakeLists.txt TVM/README.md Open Deep Learning Compiler Stack Documentat ...

  6. TVM,Relay,Pass

    TVM,Relay,Pass Relay介绍 主要结合TVM的文档(https://tvm.apache.org/docs/dev/relay_intro.html),介绍一下NNVM的第二代Rela ...

  7. LED芯片,应用品,蓝宝石衬底,集成电路,UV

    LED芯片,应用品,蓝宝石衬底,集成电路,UV 三安主要从事全色系超高亮度LED芯片的研发,生产与销售,产品性能稳定,品质优异. 产品覆盖 三安能够提供全波长范围的LED,产品可覆盖全部可见光和不可见 ...

  8. CPU,GPU,Memory调度

    CPU,GPU,Memory调度 HDD&Memory&CPU调度机制(I/O硬件性能瓶颈) 图1. HDD&Memory&CPU调度图 CPU主要就是三部分:计算单元 ...

  9. 自动驾驶QNX,Linux,Autosar概述

    自动驾驶QNX,Linux,Autosar概述 QNX是一个分布式.嵌入式.可规模扩展的实时操作系统.遵循POSIX.1 (程序接口)和POSIX.2 (Shell和工具).部分遵循POSIX.1b( ...

  10. i.MX6UL: i.MX 6UltraLite处理器 - 低功耗,安全,Arm® Cortex®-A7内核

    i.MX6UL: i.MX 6UltraLite处理器 - 低功耗,安全,Arm® Cortex®-A7内核 概述 i. MX6UltraLite作为i.MX6系列的扩展,一系列高性能.超高效的处理器 ...

最新文章

  1. valgrind——Cachegrind分析CPU的cache命中率、丢失率,用于进行代码优化。
  2. 福利满满 | 天元MegEngine贡献者计划全面启动!
  3. 国外少儿PYTHON编程书推荐
  4. .net mysql查询数据库连接_asp.net连接查询SQL数据库并把结果显示在网页上(2种方法)...
  5. HTML知识积累及实践(六) - pre,混合框架
  6. IMAP协议与imbox第三方库读取所有邮件
  7. APP测试工具大全,建议收藏
  8. html的 作用 是什么,html的作用
  9. Silk这个网站是用来在线绘制对称图形的
  10. android 串口通信打开失败
  11. 关于二维数组传参做形参
  12. Idea使用“ctrl+/”快捷键进行 行注释 时,在//后自动添加空格
  13. 汇编语言——指令系统小结
  14. 怀念那些年我们每天使用的经典DOS程序
  15. docker 搭建Jenkins持续集成平台
  16. 利用C++逆向知识写CS辅助,轻松实现透视原理!
  17. Win7键盘组合快捷键大全
  18. Java对象内存布局和对象头
  19. CAD字体大全 集合2458种字体
  20. 2019智能手表推荐_2019年,这4款智能手表已经秒杀Apple Watch!

热门文章

  1. SpringBoot项目利用maven自定义打包结构
  2. python3学习者的福音
  3. fatal error C1083: 无法打开包括文件:dxtrans.h: No such file or directory
  4. 自动化测试中Python与C/C++的混合使用
  5. [python]如何清屏?也就是实现clear?
  6. Linux 系统如何查看硬盘UUID与修改
  7. [html] 写个布局,当页面高度不够时,底部固定在下面,反之不固定
  8. [css] 怎么IE6下在使用margin:0 auto;无法使其居中?
  9. 前端学习(2565):watch监听
  10. “约见”面试官系列之常见面试题第十三篇之css动画效果(建议收藏)