Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It would be nice to get the icon by string for late binding #5

Closed
ride4sun opened this issue Feb 5, 2019 · 11 comments
Closed

It would be nice to get the icon by string for late binding #5

ride4sun opened this issue Feb 5, 2019 · 11 comments

Comments

@ride4sun
Copy link

ride4sun commented Feb 5, 2019

Hello, thank you for this great package.
I using late binding and would like to define Icons by there name like MdiIcons('sword').
That would allow me to define the icons in the domain without the reference of the package and I could create the UI dynamically in run-time.

@ziofat
Copy link
Owner

ziofat commented Feb 5, 2019

That is a great idea, I will try this in days.

@ride4sun
Copy link
Author

ride4sun commented Feb 5, 2019

@ziofat thx thats really cool

@ride4sun
Copy link
Author

ride4sun commented Feb 16, 2019

@ziofat I was just wondering if you found the time to work on it. Is there something I can do?

@ziofat
Copy link
Owner

ziofat commented Feb 16, 2019

@ride4sun Hi, I have published a new version of this package. Check readme to see is that satisfied you.

@ride4sun
Copy link
Author

@ziofat
Thank u. I will try it in the next few day and let u know. Great work.

@ride4sun
Copy link
Author

ride4sun commented Feb 19, 2019

@ziofat I think a static method would look better like:

MDiIcons.fromString(bloc.iconName)

instead of

MdiIcons()[bloc.iconName])

everything else is static and MdiIcons()[bloc.iconName] would be the only place where you would create an instance. Otherwise awesome!

@ziofat
Copy link
Owner

ziofat commented Feb 20, 2019

I think you are right. I didn't put consideration in this.

@miguelangel-nubla
Copy link

Keep in mind that It is still useful to have a map that can be iterated to list or dynamically search icons by text.

In that regard, would it be possible to include the description and aliases as shown on the web page in a similar way?
That would enable users to build icon pickers.

@ziofat
Copy link
Owner

ziofat commented Feb 20, 2019

@miguelangel-nubla I do know that aliases exist but they can not be used to access icon in material-design-icon.
I can try to add alias support in example.

@ride4sun
Copy link
Author

ride4sun commented Feb 20, 2019 via email

@ziofat
Copy link
Owner

ziofat commented Mar 5, 2019

closing this with 3.2.3595.

@ziofat ziofat closed this as completed Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants