I am just starting to learn AngularJS and I am unsure if my POST request is functioning correctly. After making the request, I am receiving an [object Object] response. What does this error indicate? Could it be related to an issue with the form?
//Activity controller
.controller('ActivityCtrl', function($scope, $rootScope, $state, $ionicLoading, $ionicScrollDelegate, PostService, $http, AuthService) {
var user = AuthService.getUser();
$http.get("http://hannation.me/api/buddypressread/activity_get_activities_grouped/?userid=" + user.data.id)
.success(function(data) {
$scope.activities = data.activities;
});
$scope.addActivity = function(){
//
var dataObj = {
new_activity : $scope.new_activity
};
$http.post('http://hannation.me/api/userplus/activities_post_update/?key=57f211a0354d7&cookie='
+ user.cookie + '&content=' + dataObj).success(function(data, status, headers, config) {
$scope.message = data;
});
$scope.new_activity='';
};
})
<form class="row">
<div class="col col-80 content col-center">
<input class="new-comment-message" type="text" placeholder="Leave a comment..." ng-model="new_activity"
name="new_activity"></input>
</div>
<div class="col col-20 button-container col-center">
<button class="button button-clear send" type="submit" ng-click="addActivity()">
Send
</button>
</div>
</form>