Merge pull request #148 from sagidayan/UI

-messages (in progress)
This commit is contained in:
Sagi Dayan 2015-08-02 20:37:42 +03:00
commit 063f15bd1d

View file

@ -47,8 +47,6 @@ angular.module('SeHub')
console.log($scope.courseObj); console.log($scope.courseObj);
if($scope.msg.msgToAdd != null && $scope.courseObj.courseName) if($scope.msg.msgToAdd != null && $scope.courseObj.courseName)
{ {
console.log("NOW");
jsonNewMsg = { jsonNewMsg = {
'groupId': $scope.courseObj.id, // TODO Should be ===> $scope.courseObj.id 'groupId': $scope.courseObj.id, // TODO Should be ===> $scope.courseObj.id
'message': $scope.msg.msgToAdd 'message': $scope.msg.msgToAdd
@ -56,13 +54,11 @@ angular.module('SeHub')
apiService.createMessage(token, jsonNewMsg).success(function(data) apiService.createMessage(token, jsonNewMsg).success(function(data)
{ {
$scope.userMessages.push(data);
}).error(function(err) }).error(function(err)
{ {
console.log(err.message); console.log(err.message);
}); });
$scope.userMessages.push({"text": $scope.msg.msgToAdd});
$location.path('/home/');
} }
else else
{ {