由于我的测试失败,我添加了从组件中引用html中的svg图像的要求。请帮助我测试用例
declare var require: any;
@Component({
selector: 'test',
templateUrl: 'test.component.html',
styleUrls: ['test.component.scss'],
})
export class TestComponent implements OnInit {
referenceImage = require("./book.svg");
}
<button mat-icon-button >
<a class="reference-route" routerLink="reference" title="Reference">
<img class="reference-image" [src]="referenceImage" />
</a>
</button>
代码结构:
project
----------apps
-------------test-frontend
-------------src
-------------assets
----------libs
----------shared
----------test
----------test.component.ts