diff --git a/home.html b/home.html index a4de540..0e41a36 100644 --- a/home.html +++ b/home.html @@ -43,8 +43,7 @@
  • Add Class
  • - -
  • Classes{{currentSection?currentSection.short_name:"Classes"}}
  • Study
  • Logout
  • @@ -86,6 +85,7 @@ + diff --git a/scripts/FeedController.js b/scripts/FeedController.js index de73c84..2dcb11b 100644 --- a/scripts/FeedController.js +++ b/scripts/FeedController.js @@ -2,7 +2,7 @@ angular.module('flashy.FeedController', ['ui.router']). controller('FeedController', function ($scope, $rootScope, $stateParams, $state, $http) { console.log('Hello from feed'); sectionId = $stateParams.sectionId; - $rootScope.sectionId = sectionId; + $rootScope.currentSection = $rootScope.SectionResource.get({sectionId: sectionId}); $scope.cards = []; var loc = window.location, new_uri; @@ -113,6 +113,7 @@ angular.module('flashy.FeedController', ['ui.router']). }; $(document).keydown(function (e) { + console.log(e.which); var keyed = e.which; if (keyed == 67 && listenForC) { // "c" or "C" for compose $('#newCard').openModal(modal_options); diff --git a/scripts/RootController.js b/scripts/RootController.js index 7c05e13..7ddc9a5 100644 --- a/scripts/RootController.js +++ b/scripts/RootController.js @@ -1,8 +1,10 @@ -angular.module('flashy.RootController', ['ui.router']). +angular.module('flashy.RootController', ['ui.router', 'ngResource']). - controller('RootController', function ($rootScope, $scope, $state, UserService) { + controller('RootController', function ($rootScope, $resource, $scope, $state, UserService) { + $rootScope.SectionResource = $resource('/api/sections/:sectionId/'); + window.rootscope = $rootScope; $rootScope.isLoggedIn = false; - $rootScope.sectionId = 0; + $rootScope.currentSection = {}; UserService.getUserData().then(function (data) { console.log(data); $rootScope.user = data;