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

Allow source to be a json, so it can be provided from Elm #101

Open
JordyMoos opened this issue Dec 10, 2017 · 0 comments
Open

Allow source to be a json, so it can be provided from Elm #101

JordyMoos opened this issue Dec 10, 2017 · 0 comments

Comments

@JordyMoos
Copy link

JordyMoos commented Dec 10, 2017

I would like to provide the suggestions from Elm but i can not bind a object to sources or call the suggestions method. Therefor it would be nice if i could provide the suggestions to the paper-autocomplete-suggestions one way or the other.

Solutions i was thinking about, which works from elm are:

  1. Json encode the suggestions and provice a json as the source/suggestions value.
<paper-autocomplete-suggestions source="[{\"text\":\"First\",\"value\":\"First\"},{\"text\":\"Second\",\"value\":\"Second\"},{\"text\":\"Third\",\"value\":\"Third\"}]" for="searchInput" ></paper-autocomplete-suggestions>
  1. Provide the data as sub elements (dunno if that is common in web components)
<paper-autocomplete-suggestions>
    <paper-suggestion text="First" value="First"></paper-suggestion>
    <paper-suggestion text="Second" value="Second"></paper-suggestion>
    <paper-suggestion text="Third" value="Third"></paper-suggestion>
</<paper-autocomplete-suggestions>

Cheers

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

1 participant