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

Multi Autocomplete #352

Closed
SerdarNur opened this issue Aug 14, 2017 · 6 comments
Closed

Multi Autocomplete #352

SerdarNur opened this issue Aug 14, 2017 · 6 comments

Comments

@SerdarNur
Copy link

Hi could you give me an example how Multi Autocomplete works on Angular2? I googled a lot and there are just examples for jquery.

@SerdarNur
Copy link
Author

SerdarNur commented Aug 14, 2017

Tried this but its not working like i want. I just can choose one.

HTML:

<div class="col s12 m9">
     <div class="autocomplete">
          <div class="ac-input input-field">
                <input type="text" id="multipleInput" placeholder="Technologien, Skills, Fertigkeiten, ..."
                       materialize="autocomplete" [materializeParams]="materializeParams" />
          </div>
          <ul id="multipleDropdown" class="dropdown-content ac-dropdown"></ul>
          <input type="hidden" name="multipleHidden"/>
    </div>
</div>

Typescript:

this.materializeParams = [
      {
        'multiple' :
          {
            enable: true,
            maxSize: 5,
            onExist: function (item) {
              console.log(item.text + ' already added.');
            }
          },
        apprender :
          {
            el: '#multipleDropdown',
            tagTemplate: '<div class="chip" data-id="<%= item.id %>" ' +
            'data-text="<%= item.text %>"><%= item.text %>' +
            '<i class="material-icons close">close</i></div>'
          },
        dropdown : {
          el: '#multipleDropdown'
        },
        data :
          {
            'apple': null,
            'google': null,
          }
      }
];

@SerdarNur
Copy link
Author

The solution i get from the code above is this: https://picload.org/view/rwowdowl/a.png.html

But i want it like this: https://picload.org/view/rwowdowi/b.png.html (this is with JQuery)

@rubyboy
Copy link
Contributor

rubyboy commented Aug 14, 2017

@SerdarN92 is this supported in MaterializeCSS? (http://materializecss.com/)
If you provide an example of vanilla MaterializeCSS that works, we could maybe check why it's not working in Angluar2.

@SerdarNur
Copy link
Author

What is the difference of MaterializeCSS and vanilla MaterializeCSS?

@rubyboy
Copy link
Contributor

rubyboy commented Aug 15, 2017

None. I was just referring to a clean MaterializeCSS implementation without Angular. The angular2-materialize is only an Angular wrapper for MaterializeCSS. If something is not supported in MaterializeCSS then the right place to discuss or open an issue for it is the MaterializeCSS repo.
On the other hand, if it works with plain MaterializeCSS then we should also support it with Angular.

@SerdarNur
Copy link
Author

Its not working with plain MaterializeCSS. Had to use another way. But thanks for trying to help.

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

2 participants