ValidateSessionComponent
的组件LoginFormComponent
。我通过将LoginFormComponent
的HTML包含在ValidateSessionComponent
中来使用ValidateSessionComponent
。到目前为止效果很好。然后,我决定通过LoginFormComponent
]中的DI也包含对ValidateSessionComponent
的引用
constructor(private loginForm2:LoginFormComponent,private helper:HelperService,private dialogService:DialogBoxService,private activatedRoute:ActivatedRoute, private router:Router, private userManagementService:UserManagementService) { }
这开始导致错误StaticInjectorError(DynamicTestModule)[ValidateSessionComponent -> LoginFormComponent]: StaticInjectorError(Platform: core)[ValidateSessionComponent -> LoginFormComponent]: NullInjectorError: No provider for LoginFormComponent!
为什么我开始出现错误?
我有一个使用LoginFormComponent的ValidateSessionComponent组件。我通过在ValidateSessionComponent的HTML中包含LoginFormComponent来在ValidateSessionComponent中使用它。这有效...
组件不是提供者。