Typeahead plugin and Bootstrap Tags input plugin Meteor not working

后端 未结 5 1246
太阳男子
太阳男子 2021-02-05 19:15

We\'ve installed \'bootstrap-tagsinput.js\' and the \'typeahead\' plugin for doing a tyepahead drop down for tags for an input field in one of our forms. The hardcoded tags work

5条回答
  •  太阳男子
    2021-02-05 19:43

    I think the source attribute should be a function.

    Template.form.rendered = function() {
        // Initialise tags input
        $('.tags').tagsinput({
            typeahead: {
                source: function(query) {
                    return ['Amsterdam', 'Washington', 'Sydney', 'Beijing', 'Cairo'];
                }
            }
        });
    };
    

提交回复
热议问题