imevro / ng-selectize

AngularJS directive for Selectize.js
39 stars 10 forks source link

ng selectize use array as source #15

Open shafaqkazmi opened 7 years ago

shafaqkazmi commented 7 years ago

How to map string array to ng selectize data. One solution is to add extra mapping like:

var items = data.map(function(x) { return { item: x }; });
$('#input-tags').selectize({
         options: items,
        labelField: "item",
        valueField: "item",
        searchField: ['item']
    });

But I don't want to introduce extra mapping on UI. Is there any better solution to tackle this scenario?