我无法测试使用带有 ngModel 的自定义组件的组件
HTML 代码如下所示(在下面的 repro 中查看更多信息)
<custom-control name="formCode" [(ngModel)]="testValue"></custom-control>
Run Code Online (Sandbox Code Playgroud)
该代码在我的应用程序中运行,但在我的测试中失败并出现以下错误
Uncaught Error: Uncaught (in promise): Error: No value accessor for form control with name: 'formCode'
错误:没有名称的表单控件的值访问器:'formCode'
测试是用茉莉花运行的
我尝试了不同的导入,但似乎没有一个能解决我的问题