[英]Uncaught TypeError: Object prototype may only be an Object or null on ember-1.0.0-pre.2
I am starting with Ember and just following this tutorial . 我从Ember开始,只是按照本教程 。 I downloaded the last source from Ember.js web and I have the following code: 我从Ember.js web下载了最后一个源代码,我有以下代码:
HTML HTML
<!doctype html>
<html>
<head>
<script src="js/libs/jquery-1.7.2.min.js"></script>
<script src="js/libs/ember-1.0.0-pre.2.min.js"></script>
<script src="js/libs/handlebars-1.0.0.beta.6.js"></script>
<script src="js/app.js"></script>
</head>
<script type="text/x-handlebars" data-template-name="application">
Test
</script>
</html>
app.js app.js
App = Em.Application.create();
App.ApplicationView = Em.View.extend({
templateName: 'application'
});
App.ApplicationController = Em.Controller.extend();
App.Router = Em.Router.extend({
root: Em.Route.extend({
index: Em.Route.extend({
route: '/'
})
})
});
App.initialize();
It seems a pretty simple example, but I fail to see these two things: 这似乎是一个非常简单的例子,但我没有看到这两件事:
1) Why the source of ember gives me this error: 1)为什么ember的来源给我这个错误:
Uncaught TypeError: Object prototype may only be an Object or null
On line 18 of the ember code. 在余烬代码的第18行。
2) Why I keep getting this uncaught error, if I have defined the template: 2)如果我定义了模板,为什么我一直收到这个未被捕获的错误:
Uncaught Error: <App.ApplicationView:ember143> - Unable to find template "application".
Try putting the application template before handlebars. 尝试将应用程序模板放在把手之前。
<!doctype html>
<html>
<head>
<script type="text/x-handlebars" data-template-name="application">
Test
</script>
<script src="js/libs/jquery-1.7.2.min.js"></script>
<script src="js/libs/handlebars-1.0.0.beta.6.js"></script>
<script src="js/libs/ember-1.0.0-pre.2.min.js"></script>
<script src="js/app.js"></script>
</head>
</html>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.