app.controller('ContactDetailController', function($scope, $stateParams, ContactsService) { $scope.selected = ContactsService.find($stateParams.id); });