[由于Toastr Manager,测试组件时出错] [1]
<img src="https://i.stack.imgur.com/hjhd9.png">
我在此组件中未使用Toastr Manager,但仍显示错误。
"Error: StaticInjectorError(DynamicTestModule)[RegistrationComponent -> ToastrManager]:
StaticInjectorError(Platform: core)[RegistrationComponent -> ToastrManager]:
NullInjectorError: No provider for ToastrManager!"
答案 0 :(得分:0)
这是因为RegistrationComponent
中存在的某些子组件正在使用它。
因此,当您创建RegistrationComponent
时,子组件UI也会在测试浏览器中呈现,并且失败。