Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="testApp">
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body ng-controller="testController">
  <ul>
    <li ng-repeat="period in periods" 
        ng-style="{'background': period.color}">
      <a href="#">{{period.title}}</a>
    </li>
  </ul>
</body>
</html>
 
li { padding: 1em; }
li a { color: black; }
 
angular.module("testApp", [  
]).controller("testController", [
  "$scope",
  function($scope){
    $scope.periods = [
      {
        title: "I am red",
        color: "#f00"
      },
      {
        title: "I am green",
        color: "#0f0"
      },
      {
        title: "I am cyan",
        color: "#0ff"
      }
    ];
  }
]);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers