Not sure if I have the routing or syntax right as I'm a little new to Angular routing. But the 'isPartial' parameter is always false.
Here is my code in Angular/Typescript where I'm calling my webservice controller. I'm passing an id and a boolean 'isPartial', the id comes in fine but the isPartial is always false
// .ts file
this.webService.add(this.claim.id, true)
.subscribe(result => {
// do some stuff
}, error => {
// take care of error
});
// web service
add(id: number, isPartial: boolean): Observable <any> {
return this.http.post(this.baseUrl + 'webservice/add/' + id, isPartial);
}
// my route
{
path: 'claim/:id',
component: ClaimComponent,
resolve: {
claim: ClaimResolver
},
canDeactivate: [PreventUnsavedChanges]
},
here is my controller
[Route("api/[controller]")]
[ApiController]
public class WebServiceController : ControllerBase
{
[HttpPost("add/{id}")]
public async Task<IActionResult> Add(int id, bool isPartial)
{
// isPartial is always false
}
}