I want to pass array value with post method in angular to php
component.ts
onSubmit(orderid,username) {
let orderdata =
JSON.stringify(this.abc);
console.log(orderid);
this.orderservice.updatestatus(orderdata, +orderid,username).subscribe(
res => {
if (res.status === 'error') {
} else {
//this.router.navigate(['/admin/block']);
this.dialogRef.close();
}
},
error => this.error = error
);
}
here this.abc is like [12,14,16]
service.ts
updatestatus(order, id: number,username: string) {
return this.http.post<any>(this.serverUrl +
'adminapi/update_order_ststus/' + id + '/' + username ,order)
.pipe(
catchError(this.handleError)
);
}
in php i want to get this array value
$uaCheckbox = json_decode($this->input->post('order'));