From 4fc5c9ba730103723674ff23dcbeac301eb900cb Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Sun, 2 Aug 2015 20:36:47 +0300 Subject: [PATCH] -messages (in progress) --- templates/js/controllers/homeController.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/templates/js/controllers/homeController.js b/templates/js/controllers/homeController.js index 7b4ed92..b0d3d59 100644 --- a/templates/js/controllers/homeController.js +++ b/templates/js/controllers/homeController.js @@ -47,8 +47,6 @@ angular.module('SeHub') console.log($scope.courseObj); if($scope.msg.msgToAdd != null && $scope.courseObj.courseName) { - console.log("NOW"); - jsonNewMsg = { 'groupId': $scope.courseObj.id, // TODO Should be ===> $scope.courseObj.id 'message': $scope.msg.msgToAdd @@ -56,13 +54,11 @@ angular.module('SeHub') apiService.createMessage(token, jsonNewMsg).success(function(data) { + $scope.userMessages.push(data); }).error(function(err) { console.log(err.message); }); - - $scope.userMessages.push({"text": $scope.msg.msgToAdd}); - $location.path('/home/'); } else {