Skip to content

Instantly share code, notes, and snippets.

@dfbaskin
Last active December 16, 2015 08:59
Show Gist options
  • Save dfbaskin/5409453 to your computer and use it in GitHub Desktop.
Save dfbaskin/5409453 to your computer and use it in GitHub Desktop.
angular
.module('myApp.ctrl.list', [])
.controller('listCtrl', ['$scope', '$http', '$location', function ($scope, $http, $location) {
$scope.people = [];
$scope.viewPerson = function (id) {
$location.path("/detail/" + id);
};
$http({
method: 'GET',
url: '/api/people'
}).success(function (data, status, headers, config) {
$scope.people = data;
});
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment