angular - 无法解析服务参数
问题描述
我在 app.module 提供程序中引用了一项服务,该服务引发了以下错误。该服务未在我的代码中使用(我将其删除以进行错误检查)。如果我删除我的提供者中的引用,我的代码就可以工作。服务有什么问题?
Uncaught Error: Can't resolve all parameters for UserService: (?).
import { ArgosUserModel } from '../argos.user.model';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
export class UserService {
constructor(private http: HttpClient) { }
getUsers(): Observable<ArgosUserModel[]> {
return this.http.get<ArgosUserModel[]>('/api/argos/GetArgosUsers');
}
}
解决方案
推荐阅读
- angular - 通过单击按钮更改进度值
- python - 'NoneType' 对象在 Django 中没有属性 'require_signature' SAML 2 身份验证
- javascript - 如果 PSD 文件中已存在具有特定名称的文件夹,是否可以添加条件?
- javascript - 被 jQuery datepicker 迷惑了
- python-3.x - TypeError:列表索引必须是整数或切片,而不是 str。从循环中选择项目时
- sql - 如何进行左连接以获取所有带有参数的行?
- r - 使用字典重命名多个 colname
- prolog - 在序言中查找所有内容
- ios - Text() 和 Divider() 之间的空格
- c# - 配置中的动态 SQL 连接类