I have the following problem.
I have two templates with the same names that constitute a editable and a readonly variant of the same template.
Two different places in my html (that is created dynamically, but it is this condition that gives me the problem) I use the template binding, and I want to bind to each of these.
The first one will then look like this:
<div data-bind="template: {name: 'myTemplate', data: $data, templateUrl: '/Templates/readonly/' }"></div>
And the second one looks like this
<div data-bind="template: {name: 'myTemplate', data: $data, templateUrl: '/Templates/editable/' }"></div>
The problem is that when I get to the second template binding, knockout will reuse the first template since it has the same name , and that will make both templates readonly.
So are there any way to make knockout download the second template if it resides in another location that the other one, or are there no way around having unique names on all of the templates.
Given the current logic, it will be a lot of work to change that, so I'm hoping that it can be done through the binding instead of renaming.
EDIT
I'm using the External Template Engine found here.