Blame view

public/js/controllers/ForumConvCtrl.js 1.12 KB
9378de0d   Geoffrey PREUD'HOMME   Affichage d'une c...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  angular.module('ForumConvCtrl', ['SessionsServ', 'ForumServ', 'NotifyServ']).controller('ForumConvCtrl', ['$scope', '$routeParams', 'SessionServ', 'ForumServ', 'NotifyServ',
      function ($scope, $routeParams, SessionServ, ForumServ, NotifyServ) {
          $scope.conv = {};
          // $scope.formData = {};
  
          $scope.session = SessionServ.cur;
          SessionServ.onChange(function () {
              $scope.session = SessionServ.cur;
          });
          ForumServ.getConv($routeParams.conv_id, function(err, conv) {
              if (!err)
                  $scope.conv = conv;
          });
          //
          // $scope.createConv = function () {
          //     ForumServ.createConv($scope.formData, function(err, conv) {
          //         if (!err)
          //             $scope.formData = {};
          //             $scope.convs.push(conv);
          //     });
          // };
          //
          // $scope.deleteConv = function (index) {
          //     ForumServ.deleteConv($scope.convs[index]._id, function(err) {
          //         if (!err)
          //             $scope.convs.splice(index, 1);
          //     });
          // };
  
      }
  ]);