ghiscoding / Aurelia-Bootstrap-Plugins

Aurelia-Bootstrap-Plugins are Custom Elements to bridge with a set of 3rd party Bootstrap addons
https://ghiscoding.github.io/Aurelia-Bootstrap-Plugins
MIT License
45 stars 23 forks source link

Using an array of objects with tag-input does not appear to work. #31

Closed matthewh closed 6 years ago

matthewh commented 6 years ago

Starting from your example in https://github.com/ghiscoding/Aurelia-Bootstrap-Plugins/tree/master/client-cli, I tried the various approaches mentioned in the documentation to get an array of objects to render with the tag input. I was not successful. Is there a bug? Am I doing something wrong?

  1. Modified bootstrap-plugins.html to bind options

    <abp-tags-input element.bind="tag" value.bind="post.categories" options.bind="tagOptions" placeholder="enter a category tag"></abp-tags-input>
  2. Modified bootstrap-plugins.js to add options and define objects.

  constructor() {
    this.post = {
      categories: [{value:'1', text: 'Javascript'} , {value:'2', text:'C#'}]
    };
    this.tagOptions = {
        itemText:'text',
        itemValue: 'value'
    };

...
ghiscoding commented 6 years ago

This is the exact same as #28 and is unfortunately out of my control as it is an issue with the Bootstrap-Tagsinput itself. Please refer to that issue #28 for more details

ghiscoding commented 6 years ago

I added a notice on the front page. It's just too bad that it's a bug within the external lib, but there isn't much I can do, sorry. However, array of strings are working correctly and are the way to go.

matthewh commented 6 years ago

Thank you for adding the note and pointing me to the issue.