[英]Ember text/x-handlebars: letter not allowed error
Going through the Ember.js GettingStarted guide section. 仔细阅读Ember.js入门指南部分。 ADDING THE FIRST ROUTE AND TEMPLATE
添加第一个路线和模板
Index.html.erb
<html>
<head>
<meta charset="utf-8">
<title>Ember.js • TodoMVC</title>
<link rel="stylesheet" href="style.css">
<script src="js/libs/jquery-1.10.2.min.js"></script>
<script src="js/libs/handlebars-1.0.0.js"></script>
<script src="js/libs/ember.js"></script>
<script src="js/libs/ember-data.js"></script>
<script src="js/application.js"></script>
<script src="js/router.js"></script>
</head>
<body>
<script type="text/x-handlebars" data-template-name="application">
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="todos">
<section id="todoapp">
<header id="header">
<h1>todos</h1>
<input type="text" id="new-todo" placeholder="What needs to be done?" />
</header>
<section id="main">
<ul id="todo-list">
<li class="completed">
<input type="checkbox" class="toggle">
<label>Learn Ember.js</label><button class="destroy"></button>
</li>
<li>
<input type="checkbox" class="toggle">
<label>...</label><button class="destroy"></button>
</li>
<li>
<input type="checkbox" class="toggle">
<label>Profit!</label><button class="destroy"></button>
</li>
</ul>
<input type="checkbox" id="toggle-all">
</section>
<footer id="footer">
<span id="todo-count">
<strong>2</strong> todos left
</span>
<ul id="filters">
<li>
<a href="all" class="selected">All</a>
</li>
<li>
<a href="active">Active</a>
</li>
<li>
<a href="completed">Completed</a>
</li>
</ul>
<button id="clear-completed">
Clear completed (1)
</button>
</footer>
</section>
<footer id="info">
<p>Double-click to edit a todo</p>
</footer>
</script>
</body>
</html>
js/application.js JS / application.js中
window.Todos = Ember.Applicaion.create();
js/router.js JS / router.js
Todos.Router.map(function() {
this.resource('todos', { path: '/' });
});
In my libs file. 在我的libs文件中。 I have the ember-data.js, ember.js, handlebars-1.0.0.js, and jquery-1.10.2.min.js (This works because when I take out the script handlebars it works)
我有ember-data.js,ember.js,handlebars-1.0.0.js和jquery-1.10.2.min.js(这是有效的,因为当我取出脚本把手时,它可以工作)
It works when I don't wrap the inner body with the todos handlebars. 当我不使用Todos把手包裹内部主体时,它会起作用。 What is happening?
怎么了?
Error message: '<' + '/' + letter not allowed here 错误消息:“ <” +“ /” +此处不允许字母
Moved your code here emberjs.jsbin.com/itAfUlO/1/edit and it looks fine. 将您的代码移动到了emberjs.jsbin.com/itAfUlO/1/edit,看起来不错。 Also added a
t
in Ember.Applicaion.create();
还在
Ember.Applicaion.create();
添加了t
Ember.Applicaion.create();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.