jjzjj

RequestOptionsIndex

全部标签

javascript - Angular 两次发送 http 请求

我用Angular4编写了一个应用程序。看起来每次我尝试访问API时,angular都会发出2个请求。我的应用程序中的所有方法都会发生这种情况,包括;获取、删除、放置、发布我将在下面添加一些代码示例。例如,我有一个NotificationComponent,它列出了来自数据库的所有通知。NotificationComponent有一个方法可以在ngOnInit上加载通知;this.NotificationService.All(AdditionalParams).subscribe(notifications=>{this.AllNotifications.Notifications=