<!DOCTYPE html> <html lang="en" ng-app="myModule"> <head> <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"/> <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/> </head> <body ng-controller="myController"> <nav class="navbar navbar-default"> <div class="container-fluid"> </div> </nav> <div class="col-md-6 well"> <hr style="border-top:1px dotted #ccc;"/> <table class="table table-bordered"> <thead class="alert-info"> <tr> </tr> </thead> <tbody style="background-color:#fff;"> <tr ng-repeat="member in members | orderBy: 'lastname'"> </tr> </tbody> </table> </div> </body> </html>
var app = angular.module('myModule', []) .controller('myController', function($scope, $http){ $scope.getData = function(){ $http.get('data.json').then(function(response){ $scope.members = response.data; }); } });