在打字稿文件中
@ViewChild(sampleFileComponent) datafiles: sampleFileComponent;
@ViewChild(sampleFileComponent, { read: ElementRef })
sampleFileElementRef: ElementRef;
private sample(event: any): void {
const nodeId= event.data.entry.id;// nodeId="123"
this.datafiles.test=nodeId;
this.sampleFileElementRef.nativeElement.querySelector('label').click();
}
如何为此功能编写单元测试