I came across this code snippet and encountered an issue while trying to clear the comment from within the response. I'm seeking assistance in figuring out how to resolve this problem.
app.controller('CommentController', function($scope, $http) {
$scope.addReview = function(obj) {
this.comment.id = obj.id;
$http.post('/save', this.comment).
then(function(response) {
obj.comments.push(response.data);
this.comment = {};
}, function(response) {
});
};
});