如果 'some-component-tag' 是一个 Angular 组件并且它有 'some-input-var' 输入,那么验证它是这个模块的一部分

If 'some-component-tag' is an Angular component and it has 'some-input-var' input, then verify that it is part of this module

我正在尝试按照 Angular2 测试文档测试我的 Angular 2 应用程序。我目前正在测试的组件有一个外部模板(我已经用外部模板测试了其他组件,并且测试 运行 很好),但是每当我尝试使用 '.compileComponents' 编译它或尝试创建一个夹具时使用 'fixture = TestBed.createComponent(testing-component);',它给了我以下错误:

Uncaught: Can't bind to 'input-variable' since it isn't a known property of 'another-component-tag'.
1. If 'another-component-tag' is an Angular component and it has 'input-variable' input, then verify that it is part of this module.
2. If 'another-component-tag' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
("

我在我的模板(html 文件)中使用 ''。但不确定为什么测试 运行ner 在创建指向我在模板文件中定义的另一个组件标签的夹具时出错。有人可以告诉我可能是什么问题吗?我已经花了几个小时解决这个问题,但仍然无法想出解决办法。

看起来我没有在规范文件的 'providers' 下声明我的测试组件中使用的其他组件。问题已解决!