2013-07-18 4 views
0

Нокаут не находит мой шаблон:Нокаут не находит мой шаблон

Uncaught Error: Cannot find template with ID response 

Что я не так? Я правильно определил шаблон.

VIEW

<script id="map" type="text/html"> 
    <div style="position:absolute;top:200px;background-color: green;width:100px;height:200px;" data-bind="text: streetName"></div>  
</script> 

<script id="reponse" type="text/html"> 
    <div style="position:absolute;top:200px;background-color: red;width:100px;height:200px;" data-bind="text: alarmNumber">3333</div> 
</script> 

<div data-bind="template: { name: currentChildTemplate(), data: selectedListItem() }"></div> 

ViewModel

return function() 
{ 
    var currentChildTemplate = ko.observable(response); 
    var selectedListItem = ko.observable(); 

    return { 
      currentChildTemplate: currentChildTemplate   
     }; 
} 
+1

Вы заметили свою ошибку в типографии –

ответ

2

Вы опечатка:

реакция на ошибку

réponse в HTML

+0

arghhh ... и я снялся 2 раза, и я прочитал ее правильно ...: S – bastienne