Skip to content

Instantly share code, notes, and snippets.

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