<!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. 学习旧岛小程序 (2) 自定义组件
  2. pppoe错误代码 linux,PPPOE常见故障代码及分析
  3. java表数据去重_java8实现列表去重,java8的stream 和lambda的使用实例
  4. python环境配置-windows版
  5. Scrum Master需要具备哪些能力和经验
  6. Ubuntu16.04 ORB_SLAM2的安装教程
  7. Unity3D基础20:游戏打包发布
  8. linux send and recv详解
  9. java 避免重定向_java – 避免循环重定向使用HttpClient 4.1.1
  10. UnsupportedOperationException:can‘t convert to dimension :typx=0x1
  11. 国内外cms网站大全
  12. 仿今日头条项目——登录注册
  13. 根据字幕自动配音的软件 如何自动识别语音识别语音生成字幕
  14. 微信语音amr文件转mp3
  15. 人脸、指纹、虹膜、行为,你需要的人工智能生物识别AI数据集全在这里
  16. CBOW(Continuous Bag-of-Words)模型原理
  17. C/C++编程题之圆桌游戏
  18. 几种解决EMI问题的方法
  19. 简历中的项目到底该如何写?面试中该如何介绍项目?看这篇就足够了
  20. 小白linux bash 学习前奏二 vi操作

热门文章

  1. EditPlus常用快捷键
  2. [VC6] RadioBox使用入门
  3. [react] React中怎么操作虚拟DOM的Class属性
  4. 前端学习(3323):高级设计说闭包
  5. React开发(133):ant design学习指南之form中input加前缀
  6. [css] z-index有时不起作用的原因是什么?怎么解决?
  7. 工作270:el-dialog的open回调
  8. 前端学习(2732):重读vue电商网站42之添加富文本编辑器
  9. 前端学习(1800):前端调试之清除浮动练习1
  10. 前端学习(1290):nodejs模块化的开发导出另一种方式