Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. .bigDiv {
  2. width: 500px;
  3. height: 500px;
  4. margin: 400px auto;
  5. background-color: black;
  6. }
  7.  
  8. ul {
  9. font-size: 0px;
  10. padding-left: 0px;
  11. }
  12. .circle {
  13. width: 20px;
  14. height: 20px;
  15. border-radius: 10px;
  16. background-color: green;
  17. position: relative;
  18. }
  19.  
  20. .todo-last {
  21. position: absolute;
  22. width: 33px;
  23. height: 33px;
  24. background-color: red;
  25. left: 25px;
  26. top: 25px;
  27. font-size: 25px;
  28. color: white;
  29. }
  30. .bigDiv li {
  31. display: inline-block;
  32. width: 100px;
  33. height: 100px;
  34. background-color: purple;
  35. }
  36.  
  37.  
  38.  
  39.  
  40. <body ng-app="app" ng-controller="controller">
  41. <div class="bigDiv">
  42. <ul>
  43. <li ng-repeat="todo in todoArray">
  44. <div class="circle">
  45. <div class="todo-last">
  46. {{todo.text}}
  47. </div>
  48. </div>
  49. </li>
  50. </ul>
  51. </div>
  52. </body>
  53.  
  54. <script>
  55. var app = angular.module('app',[]);
  56. app.controller('controller',["$scope",function ($scope) {
  57. var randomNum = Math.ceil(Math.random() * 15 + 1);
  58. var array = [];
  59. for(var i = 0 ; i < randomNum; i++){
  60. if((randomNum -2)===i ){
  61. array.push({
  62. text: 100
  63. });
  64. continue;
  65. }
  66. array.push(
  67. {text: i}
  68. )
  69. }
  70. $scope.todoArray = array;
  71.  
  72. }])
  73. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement