HalitTalha / ng-material-extensions

Extended features for @angular/material components
Apache License 2.0
101 stars 52 forks source link

Remove <mat-icon> name from cell if they exist #23

Open xavirp opened 5 years ago

xavirp commented 5 years ago

Hi, I use mat-icons in some cells, just for showing filtering menus in the header, or when the cell is empty. I would be great if you could remove the name of the icon from the cell. BTW it's a great job

HalitTalha commented 4 years ago

Thank you for the feedback. I'll label this as a feature request for now.

ccosmincc commented 4 years ago

@xavirp until this is supported, as a workaround, you could switch (if applicable for your project) from 'font icons with ligatures' approach of defining mat-icon to 'named icons' approach. E.g.: current <mat-icon>name</mat-icon> will become <mat-icon svgIcon="name"></mat-icon> (don't forget to register). This approach provides desired behavior, icon names no longer being present in exported file.

gremmil commented 2 years ago

For those who still have the same problem, I recommend using codepoints with css. HTML code: <i class="material-icons"></i> CSS code:

 i::before {
          font-family: "Material Icons";
          content: "\ef4f";//Here we put the codepoint of the icon
        }

And with this it should be solved.

oubaydos commented 3 weeks ago

using fontIcon attribute instead of putting the name inside the innerText solved this for me