Skip to content

Instantly share code, notes, and snippets.

Created November 1, 2014 05:36
Show Gist options
  • Save anonymous/779a5b4766406aed66f5 to your computer and use it in GitHub Desktop.
Save anonymous/779a5b4766406aed66f5 to your computer and use it in GitHub Desktop.
<!doctype html>
<html ng-app="myApp">
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/foundation/4.3.2/css/foundation.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular.js"></script>
<style id="jsbin-css">
.odd {
background-color: blue;
}
.even {
background-color: red;
}
</style>
</head>
<body>
<ul ng-controller="PeopleController">
<li ng-repeat="person in people" ng-class="{even: !$even, odd: !$odd}">
{{person.name}} lives in {{person.city}}
</li>
</ul>
<script id="jsbin-javascript">
angular.module('myApp', [])
.controller('PeopleController', function($scope) {
$scope.people = [
{name: "Ari", city: "San Francisco"},
{name: "Erik", city: "Seattle"}
];
});
</script>
<script id="jsbin-source-html" type="text/html"><!doctype html>
<html ng-app="myApp">
<head>
<link rel="stylesheet" href="//cdn.jsdelivr.net/foundation/4.3.2/css/foundation.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular.js"><\/script>
</head>
<body>
<ul ng-controller="PeopleController">
<li ng-repeat="person in people" ng-class="{even: !$even, odd: !$odd}">
{{person.name}} lives in {{person.city}}
</li>
</ul>
</body>
</html></script>
<script id="jsbin-source-css" type="text/css">.odd {
background-color: blue;
}
.even {
background-color: red;
}</script>
<script id="jsbin-source-javascript" type="text/javascript">angular.module('myApp', [])
.controller('PeopleController', function($scope) {
$scope.people = [
{name: "Ari", city: "San Francisco"},
{name: "Erik", city: "Seattle"}
];
});</script></body>
</html>
.odd {
background-color: blue;
}
.even {
background-color: red;
}
angular.module('myApp', [])
.controller('PeopleController', function($scope) {
$scope.people = [
{name: "Ari", city: "San Francisco"},
{name: "Erik", city: "Seattle"}
];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment