Skip to content

Instantly share code, notes, and snippets.

@esvit
Last active December 26, 2015 00:09
Show Gist options
  • Save esvit/7061932 to your computer and use it in GitHub Desktop.
Save esvit/7061932 to your computer and use it in GitHub Desktop.
ngTable: Getting Started
<html>
<head lang="en">
<meta charset="utf-8">
<title>Getting Started With ngTable Example</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/esvit/ng-table/master/ng-table.js"></script>
<link rel="stylesheet" type="text/css" href="https://raw.github.com/esvit/ng-table/master/ng-table.css" />
</head>
<body>
<div id="demo" ng-controller="MyCtrl">
<table ng-table class="table">
<tr ng-repeat="user in users">
<td data-title="'Name'">{{user.name}}</td>
<td data-title="'Age'">{{user.age}}</td>
</tr>
</table>
</div>
</body>
</html>
var app = angular.module('myApp', ['ngTable']);
app.controller('MyCtrl', function($scope) {
$scope.users = [
{name: "Moroni", age: 50},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{name: "Enos", age: 34}
];
});
angular.bootstrap(document.getElementById('demo'), [app.name]);
.ng-table {
border: 1px solid #000;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment