ng-style的用法
来源:互联网 发布:电脑桌面时间软件 编辑:程序博客网 时间:2024/06/09 14:32
html
<table> <tbody> <tr> <td style="padding:50px;border:1px soild red" ng-style="data"> </td> </tr> </tbody></table>
js
var a=[{'red': '0','green': '0', 'blue': '0' }, {'red':'255','green': '255','blue': '255'},{'red': '255','green':'0','blue': '0'}]; console.log(a); var b=[]; for(var i=0;i<a.length;i++){ b.push({'background-color':'RGB('+a[i].red+','+a[i].green+','+a[i].blue+')'}); } } $scope.myObject = b; console.log($scope.myObject);
注意
1.ng-style的值是用双引号括起来的 2.push css的时候,中间的冒号是不用放在双引号里面的。
0 0
- ng-style的用法
- ng-style用法
- angularjs ng-style background-image的用法及坑
- angularJs工作笔记-ng-class、ng-style的几种用法
- 使用了ng-repeat 后的样式显示 ng-class 、ng-hide ng-show ng-if ng-style
- ng-style用于背景图片的样式方法
- ng-repeate 和ng-show的用法
- Style.display 的用法
- AngularJS ng-style 指令
- angularjs ng-show的用法
- 【Angular】ng-disabled的用法;
- ng-class、ng-style、ng-href、ng-attr-title
- javascript的style.display用法
- java中style的用法
- HTML中 Style的用法
- 关于Style的用法例子
- Vue之style的用法
- Angularjs中ng-select和ng-options的用法详解
- 特殊IP地址类型
- 套接字和文件描述符
- matrix 2d in CSS3
- thinkphp前台模板运算符
- getResources()方法带来的NullPointerException
- ng-style的用法
- LitePal的一些使用方法
- html的选择器使用
- 在Ubuntu系统中下载Android源码
- stampede上编译c和fortran混编程序multiple definition of `main'问题解决
- PIGCMS weimi 如何关闭聊天机器人
- 程序命名规范
- ns和gt-itm在ubuntu安装及使用
- Lua脚本语言简明入门教程