首页 > 解决方案 > 以角度捕获从 REST 返回的字符串。我已经实现了它,但我想知道它是否以正确的方式完成

问题描述

在 Angular Service.ts 中:

changePriority(ticket : TicketDetails) {
    return this.http.put("api/serviceEngineer/updatePriority", ticket, {responseType : 'text'})
  }

I declared the Http Client in the following way using a constructor:

constructor(private http: HttpClient) { }

通过这种方式,我以角度捕获从 REST 返回的字符串,但我从一位朋友那里知道这不是正确的方法,我想知道究竟是为什么。他是说它永远是活跃的,不像 Observable。任何帮助都将是非常可观的。谢谢!!!

标签: angularspringspring-boot

解决方案


推荐阅读