I'm currently developing an Angular 10 application that utilizes Angular Material Icons. I am in search of a method to dynamically showcase a dropdown menu containing all the available Material Icons.
My attempt to programmatically retrieve the icon list using MatIconRegistry has been unsuccessful so far, as the icons array remains empty. Here is the relevant code snippet:
this.matIconRegistry['_iconSetConfigs'].forEach((config: any) => {
if (config.names) {
config.names.forEach((name: string) => {
const sanitizedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(config.url);
ics.push(name);
});
}
});
Is there a dependable method to fetch the list of Material Icons and exhibit them in a dropdown within Angular 10?
Any suggestions or alternative approaches would be greatly valued.
Thank you!
My goal is to achieve something similar to the following image: https://i.stack.imgur.com/932zY.png