سؤال

I am using Knockout with jQuery tmpl.

How can I pass some data inside a template "filter-string" if I call it like that:

{{tmpl() '#filter-string'}}

My template looks like that:

<script type="text/html" id="filter-string">
   <input type="text" data-bind="value: $data" />
</script>

How can I apply jquery date picker on textbox after template rendered?

هل كانت مفيدة؟

المحلول

From the knockout.js tutorial, here's how you pass the data into template when you do your binding:

<div data-bind="template: { name: 'person-template', data: buyer }"></div>

provide more code if that's not what you're after

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top