angular修改标签css修改的三种方法
来源:互联网 发布:淘宝互刷红包群 编辑:程序博客网 时间:2024/05/29 19:32
1:scope变量绑定
<div ng-app="index_app" ng-controller="index_controller"><button class="btn btn-default btn-lg" type="submit" ng-click="change_play_status3()"><span class="glyphicon {{play_status}}" aria-hidden="true"></span></button></div><script>var index_app = angular.module('index_app', []);index_app.controller("index_controller",function($scope){$scope.play_status = "glyphicon-play";$scope.change_play_status3 =function(){if($scope.play_status == "glyphicon-play"){$scope.play_status = "glyphicon-pause"}else if($scope.play_status == "glyphicon-pause"){$scope.play_status = "glyphicon-play"}};});</script>
2:字符串数组形式
<div ng-app="index_app" ng-controller="index_controller"><button class="btn btn-default btn-lg" type="submit" ng-click="change_play_status()"><span class="glyphicon" ng-class="{true:'glyphicon-play',false:'glyphicon-pause'}[isPlay]" aria-hidden="true"></span></button></div><script>var index_app = angular.module('index_app', []);index_app.controller("index_controller",function($scope){$scope.isPlay = false;$scope.change_play_status = function(){$scope.isPlay = !$scope.isPlay;};});</script>3:对象key/value处理
<div ng-app="index_app" ng-controller="index_controller"><button class="btn btn-default btn-lg" type="submit" ng-click="change_play_status2()"><span class="glyphicon" ng-class="{'glyphicon-play':isPlay2,'glyphicon-pause':isPause2}" aria-hidden="true"></span></button></div><script>var index_app = angular.module('index_app', []);index_app.controller("index_controller",function($scope){$scope.isPlay2 = false;$scope.isPause2 = true;$scope.change_play_status2 =function(){$scope.isPlay2 = !$scope.isPlay2;$scope.isPause2 = !$scope.isPause2;};});</script>
0 0
- angular修改标签css修改的三种方法
- JS修改CSS的三种方式
- JS修改CSS的三种方式
- jquery修改css的两种方法
- HTML&CSS中修改非块级元素宽高的三种方法
- mysql三种修改用户密码的方法
- 修改linux环境变量的三种方法
- 修改VMWARE BIOS的三种方法
- 修改环境变量的三种方法
- Linux修改IP的三种方法
- Angular 修改
- 修改a标签height,width的方法
- angular的修改,性别筛选
- 【转、修改】添加css的几种方法
- js伪类的css修改方法
- 与CSS的{}冲突,修改Smarty的标签
- css修改a标签里面的title的样式
- dedecms xhtml+css模板中,友情链接标签生成的修改
- 单词拆解&前缀树&树上DP LA 3942 Remember the Word
- UILabel使用自定义字体
- C++读写.mat文件
- Android 升级数据库的最佳写法
- 蚂蚁金服张洁:基于深度学习的支付宝人脸识别技术解秘
- angular修改标签css修改的三种方法
- C++面试问题
- 自定义单元格
- 犀牛——第7章数组 7.9数组方法
- Git could not resolve the host github.com error/Git push 403 error
- sprintf和sscanf详解
- 常用docker命令
- Swift修改tabBarItem选中色和tabBar背景色
- 线程池中捕获线程执行异常