I've got some sample code for a form, and now i want to post that data to Restful API. I've checked lot but mostly found results based on TypeScript. I want to do that using only JavaScript. Is there any way to do that using JavaScript?
I want to call Post API on "onSubmit" event. Look at sample code.
(function(app) {
app.FormComponent = ng.core
.Component({
selector: 'form',
templateUrl: 'app/form.component.html'
})
.Class({
constructor: function() {
},
onSubmit: function() {
console.log(this.model);
this.submitted = true;
},
});
})(window.app || (window.app = {}));