notes-index-controller.js 413 B

1234567891011121314
  1. angular.module('NoteWrangler').controller('NotesIndexController', function($scope, Note, Session) {
  2. // Without NgResource
  3. // Note.all().success(function(data) {
  4. // $scope.notes = data;
  5. // });
  6. // With NgResource
  7. $scope.notes = Note.query();
  8. Session.sessionData().success(function(sessionUser) {
  9. // Create a new User from the session user data
  10. $scope.loggedIn = !!sessionUser;
  11. });
  12. });