My unit test source code:
@Component({
selector: 'cx-host'.template: ` <div id="a" [cxFocus]="{ autofocus: true, refreshFocus: model.uid }"></div>`.changeDetection: ChangeDetectionStrategy.Default,
})
class MockComponent {
model = "";
}
Copy the code
Change the code for import from the following figure to:
from '@angular/core'
Copy the code
The problem goes away
More of Jerry’s original articles can be found in “Wang Zixi” :