请您帮我下面的代码,以便我可以动态注册多个svg并动态使用domsanitizer
import { Component, OnInit } from '@angular/core'
import { DomSanitizer } from '@angular/platform-browser'
import { MatIconRegistry } from '@angular/material'
@Component({
selector: 'oc-logo',
template: `<mat-icon svgIcon="theater"></mat-icon>`,
styles: [''],
})
export class LogoComponent implements OnInit {
constructor(iconRegistry: MatIconRegistry, sanitizer: DomSanitizer) {
iconRegistry.addSvgIcon(
'theater',
sanitizer.bypassSecurityTrustResourceUrl('../../../.././assets/logo/theater.svg')
)
}
ngOnInit() {}
}