You can use NO_ERRORS_SCHEMA inside TestBed.configureTestingModule({}), it will tell angular to ignore unknown elements(您可以在TestBed.configureTestingModule({})中使用NO_ERRORS_SCHEMA ,它将告诉angular忽略未知元素)
TestBed.configureTestingModule({
declarations: [],
schemas: [ NO_ERRORS_SCHEMA ]
})
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…