我想将带有post方法的数组值以角度的方式传递给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
);
}
在这里this.abc就像[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)
);
}
在php中,我想获取此数组值
$uaCheckbox = json_decode($this->input->post('order'));