hunterloftis / knockout.namespaces

Namespaces plugin for KnockoutJS
knockoutjs.com
57 stars 5 forks source link

Doesn't work inside templates? #2

Closed Enome closed 13 years ago

Enome commented 13 years ago

Does the namespacing work inside templates? The following code doesn't seem to be working:

<ul data-bind-users='template: { name : "UserTmpl", foreach: users }'></ul>
<script type='text/html' id='UserTmpl'>
<li>
  <input type='text' data-bind-users='value: name' /> 
  <p data-bind-users='text: name'></p>
</li>
</script>

You can find the complete example here: https://github.com/Enome/knockout.namespaces/blob/master/examples/simple.html which is a fork of your simple.html

Friendly Greetings

hunterloftis commented 13 years ago

Enome,

Thanks for pointing that out! Turns out templating is a sort of non-standard and complex binding that involves memoizing bindings within template script blocks and stuff. I just implemented namespaced templating, but I haven't tested it very far so your feedback would be great.

https://github.com/hunterloftis/knockout.namespaces/blob/master/examples/templates.html

-H