user2904389
user2904389

Reputation: 43

KO Cannot find template with ID

I am trying to bind a template to my view. But I keep getting template with ID error.

Template: <script type="text/html" id="Template">
//some html markup </script>

View : <div data-bind="template: {name: 'Template'}"></div>

Upvotes: 1

Views: 3592

Answers (1)

Michael Best
Michael Best

Reputation: 16688

It works!

ko.applyBindings({});
<script src="//knockoutjs.com/downloads/knockout-3.3.0.js"></script>
<script type="text/html" id="Template">
  some Markup
</script>

<div data-bind="template: {name: 'Template'}"></div>

Upvotes: 3

Related Questions