notes-show-controller.js 407 B

12345678910111213
  1. angular.module('NoteWrangler').controller('NotesShowController', function($scope, $routeParams, Note, Session) {
  2. // Without NgResource
  3. // Note.find($routeParams.id).success(function(data) {
  4. // $scope.note = data;
  5. // });
  6. // With NgResource
  7. $scope.note = Note.get({id: $routeParams.id})
  8. Session.sessionData().success(function(sessionUser) {
  9. $scope.currentUser = sessionUser;
  10. });
  11. });