Feature request: Add custom icon as svg file within typescript #20940
anschm
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem?
No response
Feature description
It would be create to have a registration service to add custom icons as a svg file to fontawsome to use it the the fa-icon angular component. This could be like angular material provides a MatIconRegistry:
export class MaterialIconsRegistryService {
constructor(private readonly matIconRegistry: MatIconRegistry,
private readonly domSanitizer: DomSanitizer) {
}
public register(): void {
this.registerSvgIconInNamespace('language-de', 'languages/de.svg');
this.registerSvgIconInNamespace('language-en', 'languages/en.svg');
}
private registerSvgIconInNamespace(iconName: string, path: string) {
this.matIconRegistry
.addSvgIconInNamespace(NAMESPACE, iconName, this.domSanitizer.bypassSecurityTrustResourceUrl(BASE_PATH + path));
}
}
It would be create to add the icon by using a namespace to seperate the local added custom icons from fontawsome.
Alternatives
No response
Additional context
No response
Feature request checklist
Beta Was this translation helpful? Give feedback.
All reactions