简体   繁体   English

未捕获的TypeError:对象原型可能只是一个Object,或者在ember-1.0.0-pre.2上为null

[英]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.

相关问题 未捕获的TypeError:对象原型可能只是一个Object,或者在ember.js上为null - Uncaught TypeError: Object prototype may only be an Object or null on ember.js 未捕获的TypeError:Symfony 2中的ExtJS对象原型只能是Object或为null - Uncaught TypeError: Object prototype may only be an Object or null with ExtJS in Symfony 2 未捕获的类型错误:Object 原型可能只是 Object 或 null:未定义 - Uncaught TypeError: Object prototype may only be an Object or null: undefined Extjs Sencha编译的应用程序引发Uncaught TypeError:对象原型只能是Object或null - Extjs sencha compiled app throws Uncaught TypeError: Object prototype may only be an Object or null TypeError: Object prototype may only be an Object or null: undefined - TypeError: Object prototype may only be an Object or null: undefined 带Typescript抛出TypeError的React Relay(react-relay):对象原型只能是一个Object或为null:未定义 - React Relay (react-relay) with Typescript throwing TypeError: Object prototype may only be an Object or null: undefined 运行dyson模拟服务器(使用express.js)的异常“ TypeError:对象原型只能是对象或为空” - Exception 'TypeError: Object prototype may only be an Object or null' running dyson mock server (using express.js) Node.JS对象原型可能只是一个Object,或者使用Redis为null - Node.JS object prototype may only be an Object or null with Redis TypeScript错误对象原型只能是一个对象或null:未定义 - TypeScript Error Object prototype may only be an Object or null: undefined 未捕获的TypeError:不可变原型对象'#<Object>'不能设置原型 - Uncaught TypeError: Immutable prototype object '#<Object>' cannot have their prototype set
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM