无法解析组件的所有参数:(???)
Can't resolve all parameters for Component: (? ? ?)
我在添加时遇到此错误
构造函数(
私人脸书:FormBuilder
)
Uncaught Error: Can't resolve all parameters for RegisterComponent: (?).
at syntaxError (compiler.js:2196)
at CompileMetadataResolver._getDependenciesMetadata (compiler.js:17927)
at CompileMetadataResolver._getTypeMetadata (compiler.js:17823)
at CompileMetadataResolver.getNonNormalizedDirectiveMetadata (compiler.js:17452)
at CompileMetadataResolver._getEntryComponentMetadata (compiler.js:18022)
at compiler.js:18014
at Array.forEach (<anonymous>)
at CompileMetadataResolver._getEntryComponentsFromProvider (compiler.js:18013)
at compiler.js:17984
at Array.forEach (<anonymous>)
我花了 3 个小时研究解决方案后发现:
对于您的情况,在您的组件 RegisterComponent
前面添加 @Injectable()
应该可以解决您的问题。
我在添加时遇到此错误
构造函数( 私人脸书:FormBuilder )
Uncaught Error: Can't resolve all parameters for RegisterComponent: (?).
at syntaxError (compiler.js:2196)
at CompileMetadataResolver._getDependenciesMetadata (compiler.js:17927)
at CompileMetadataResolver._getTypeMetadata (compiler.js:17823)
at CompileMetadataResolver.getNonNormalizedDirectiveMetadata (compiler.js:17452)
at CompileMetadataResolver._getEntryComponentMetadata (compiler.js:18022)
at compiler.js:18014
at Array.forEach (<anonymous>)
at CompileMetadataResolver._getEntryComponentsFromProvider (compiler.js:18013)
at compiler.js:17984
at Array.forEach (<anonymous>)
我花了 3 个小时研究解决方案后发现:
对于您的情况,在您的组件 RegisterComponent
前面添加 @Injectable()
应该可以解决您的问题。