1
我只是試圖使用Handlebars助手渲染視圖。使用手柄助手來渲染視圖不起作用
Uncaught TypeError: Cannot call method 'apply' of undefined
把手:
<script type='text/x-handlebars'>
{{outlet}}
</script>
<script type='text/x-handlebars' id="index">
INDEX
{{my-component-helper}}
</script>
<script type='text/x-handlebars' id="myComponentHelper">
I'm here
</script>
JS:
App = Ember.Application.create();
Ember.Handlebars.helper('my-component-helper', App.MyComponentHelperView);
App.MyComponentHelperView = Ember.View.extend({
templateName:'myComponentHelper'
});
下面是一個JSbin說明問題: http://jsbin.com/edUm/1/edit
當應用程序運行我不斷收到一個錯誤