I am working on a website that contains a field called comments where some particular users can post those comments. My HTML code:
<form>
<input ng-model="stack"></input>
<button ng-click="save()">Save</button>
<p>Your comment: <span ng-bind="stack"></span></p>
</form>
The comments should be saved in to a variable then, posted in my web service which is a json file so I can do my Database calls. I have to use $http.post I am using AngularJS and I have written my webservice using java (JAXB).
//Controller:
$scope.save = function() {
alert(name);
}
//In save I put alert to test because all the functions save I tested hadn't done what I need.
//server
$http({
method: 'POST',
url: 'url',
data: "stack="
});