我的angular 7应用程序可以在计算机上正常运行,但是可以t send post requests from mobile. here
编写代码
public onOrderSubmit() {
alert("function started");
if (this.orderForm.invalid) {
alert("invalid form");
return;
}
if (this.orderForm.valid) {
alert("valid form");
let payLoad = this.orderForm.value;
this.OrdersService.newOrder(payLoad).subscribe(response => {
alert("recived");
if (response["status"] == 200) {
alert("success");
this.OrdersService.notifySuccess("Your order sent");
} else {
alert("error");
this.OrdersService.notifError("Please try again");
}
alert("clear...");
this.orderForm.reset();
alert("done");
});
}
}
public newOrder(payLoad) {
alert("service function started");
return this.http
.post(this.url + "/order/new", payLoad)
.pipe(map(response => {
alert("in map");
return response
}))
}
此功能警报的最后一件事是“服务功能已启动”,但在计算机上工作正常 有什么想法吗?