У меня есть служба ниже с подпиской " Пользователь ".
public getEmployees(): Observable<User> {
const url = `${this.baseUrl}/employee`;
return this.http.get<User>(url);
}
Мой вопрос: как я могу вызвать getEmployees с данными пользователя. Я пытаюсь с приведенным ниже кодом, но он получает ошибку?
const _user: User = {
userId: "30294
}
this.userAccountService.getEmployees().subscribe((userprofile: _user) => {
console.log(userprofile.firstName);
});
ошибка: _user ссылается на значение, но здесь используется тип