Skip to content

Instantly share code, notes, and snippets.

@sunkay
Created April 21, 2013 19:30
Show Gist options
  • Save sunkay/5430754 to your computer and use it in GitHub Desktop.
Save sunkay/5430754 to your computer and use it in GitHub Desktop.
// controllers
function deviceListController($scope)
{
$scope.devices = [
{name: "iphone", assetTag:"a23456", owner:"dev", desc:"iOS4.2"},
{name: "loaner-laptop-1", assetTag:"a13936", owner:"dev", desc:""},
{name: "loaner-laptop-3", assetTag:"a43056", owner:"qa", desc:""},
{name: "android", assetTag:"a33756", owner:"dev", desc:"android2.4"},
{name: "galaxy tab", assetTag:"a53356", owner:"dev", desc:"android"},
{name: "loaner-laptop-2", assetTag:"a63556", owner:"qa", desc:""},
{name: "iphone", assetTag:"a73856", owner:"dev", desc:"iOS5"}
];
}
<html ng-app>
<head>
<title>Check out your device</title>
<link rel="stylesheet" href="../bootstrap/css/bootstrap.css">
</head>
<body>
<h2>List of Devices</h2>
<div ng-controller="deviceListController">
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Asset Tag</th>
<th>Owner</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in devices">
<td>{{item.name}}</td>
<td>{{item.assetTag}}</td>
<td>{{item.owner}}</td>
<td>{{item.desc}}</td>
</tr>
</tbody>
</table>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>
<script src="cotd.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment