私はノックアウトでtag-itを使用しようとしています:
これは私のhtmlです:
<input placeholder="Tags" class="tagsInput" data-bind="tags:{}, tagitOptions: { initiateTags: myTags, tagSource: allMyTags, placeholder: 't-æ-g-g'}" />
どこ
myTags = ko.observableArray([]);
allMytags = ko.observableArray([]);
私のバインディングは次のようなものです:
ko.bindingHandlers.tags = {
init: function (element, valueAccessor, allBindingsAccessor) {
var options = allBindingsAccessor().tagitOptions || {};
$(element).tagit(options);
},
update: function (element, valueAccessor) {
//I´ll leave this til later...
}
}
Firebug は options.initiateTags() = [ "myTag1", "myTag2" ] および options.placeholder = "t-æ-gg" と言っています。しかし、tagit は私の initializeTags を表示しません。なんで?