Global override of icons in primeng components #1994
Unanswered
alexciesielski
asked this question in
PrimeNG
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently there is no easy way to use a custom icon component in places like menu items, other than completely overriding the menu item's template. Ideally I would keep primeng's default item template but still have the possibility to use a different icon set / component.
Proposal: define a global injection token
which by default would be a default icon component (to be implemented) whose template would simply consist of
<i [class]="icon" />
, whereicon
would be an Angular@Input
and would receive the icon property of the menu item, like so:This way I could define my own Angular component which would implement the above interface, and which I could then provide using the injection token, and next primeng would inject the token in every component that makes use of primeng's icons and render it, like so:
This would be a lot cleaner than the current suggested solution, it would also apply globally and not only for single icons across some components.
I would be willing to implement this if given the green light.
Actually it was such an easy thing to implement I went ahead and did it here.
Let me know your toughts there.
Beta Was this translation helpful? Give feedback.
All reactions