Commit 344b499fae1fb2d8b06e7b998d9a1f2a919e7d85

Authored by Andrew Buss

merge

Showing 2 changed files Side-by-side Diff

scripts/DeckController.js View file @ 344b499
1 1 var app = angular.module('flashy.DeckController', ['ui.router']);
2 2  
3   -app.controller('DeckController', ['$scope', '$http', function($scope, $http) {
4   -
5   -
6   -
7   -
8   -
9   -
  3 +app.controller('DeckController', ['$scope', '$http', '$stateParams',
  4 + function($scope, $http, $stateParams) {
10 5 // cards array
  6 + sectionId = $stateParams.sectionId;
11 7 $scope.cards = [];
12 8  
13   - $scope.cards[0] = { 'content': 'abc' };
14   - $scope.cards[1] = { 'content': 'xyz' };
15   - $scope.cards[2] = { 'content': 'qwe' };
  9 + $http.get('/api/sections/' + sectionId + '/deck/').
  10 + success(function(data) {
  11 + console.log(data);
  12 + $scope.cards = data;
  13 + }).
  14 + error(function(err) {
  15 + console.log('pulling feed failed');
  16 + });
16 17  
17 18  
18 19 // reorganize cards in array based on time
scripts/RootController.js View file @ 344b499
... ... @@ -12,5 +12,12 @@
12 12 console.log(data);
13 13 $rootScope.user = data;
14 14 });
  15 +
  16 + $('.button-collapse').sideNav({
  17 + menuWidth: 300, // Default is 240
  18 + edge: 'right', // Choose the horizontal origin
  19 + closeOnClick: true // Closes side-nav on <a> clicks, useful for Angular/Meteor
  20 + }
  21 + );
15 22 }]);