Sending a Post Request in DataTables for Angular 2

Sending a Post Request in DataTables for Angular 2

MrSinghMrSingh Posts: 1Questions: 1Answers: 0
edited February 2017 in Free community support

I am trying to build a dynamic 'Post' request in Angular 2. I have a filter, consisting of inputs. I want to set them as defaults when empty and dynamically populate the request when someone uses those filters and clicks submit. So from the code snippet below I want to the user to be able to change the date and pass it to the request. So what is the best way to do this in Typescript/Angular 2?

```

ajax: {
"url": 'http://my-request.json',
"type": "POST"
data: function ( d ) {
return JSON.stringify({
"id":1234,
"filters":{
"type":"TCA",
"flag":false,
"description":"description",
"startdate":"20/01/2016",
"enddate":"30/01/2018"
},
"pagination":{
"startPageNumber":2,
"itemsPerPage":10
}
});
},
},

This discussion has been closed.