我正在寻找Angular中在UI component和Angular服务之间进行通信的最佳实践。 我的UI有一个status bar component。它有一个signin按钮。当用户登录时,username和password将从status bar component发送到angular service。然后,angular service使用http.post方法将请求发送到
给出了向某个后端服务器发出POST请求的示例。/** POST: add a new hero to the database */ return this.http.posthero, httpOptions) catchError(this.handleError('addHero', hero))}
但是我搞不懂为什么Observable在<