users-show-controller.js 402 B

1234567891011121314
  1. angular.module('NoteWrangler').controller('UsersShowController', function($scope, $routeParams, User, $gravatar) {
  2. // Without NgResource
  3. // User.find($routeParams.id).success(function(data) {
  4. // $scope.user = data;
  5. // });
  6. // With NgResource
  7. $scope.user = User.get({id: $routeParams.id});
  8. $scope.gravatarUrl = function(user) {
  9. return $gravatar.generate(user.email);
  10. }
  11. });