stevermeister/ngx-wig

Is it possible to use Google Material Icons?

Closed this issue · 2 comments

Hi,

I would like to use these icons:

https://material.io/icons/

and I have this in my index.html:

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

In this pack the "bold" icon is called "format_bold". Is it possible to use this? I find it hard to understand from the Readme how to use other sets of icons.

it's not possible right now, you are welcome to share your thoughts what's the best way to implement it

A solution I often use myself is icon maps.

In ngx-wig component:

// class level
@Input() buttonIcons: { [key:string]: string } = {}; 
public buttonIconMap: { [key:string]: string } = {};

// constructor
this.buttonIconMap['bold'] = 'default-bold-icon-class';

// ngOnInit
if (this.buttonIcons['bold']) this.buttonIconMap['bold'] = this.buttonIcons['bold'];

In ngx-wig html:

<button name="bold" [ngClass]="buttonIconMap['bold']" ...

In parent/consumer html:

<ngx-wig [buttonIcons]="{'bold': 'my-custom-bold-class'}" ...