【发布时间】:2013-12-09 19:53:53
【问题描述】:
我是 EmberJS 的新手并遵循本教程:
http://coding.smashingmagazine.com/2013/11/07/an-in-depth-introduction-to-ember-js/
目前我有这个文件结构:
index.html
static/js/app.js
static/js/compononents
static/js/controllers/usersController.js
static/js/handlebars-v1.1.2.js
static/js/helpers
static/js/models/user.js
static/js/router.js
static/js/routes/usersRoute.js
static/js/store.js
static/js/templates/application.hbs
static/js/templates/index.hbs
static/js/templates/user.hbs
static/js/templates/users.hbs
static/js/views/
目前我已经获得了“单一用户路线”部分之前的所有代码。
我完全按照教程进行操作,但是当我转到 http://ember.lusenet.com/#/users 时,我收到错误消息“断言失败:URL '/users' 与您的应用程序中的任何路由都不匹配”。我真的不知道出了什么问题。任何帮助表示赞赏!
【问题讨论】:
-
据我在提供的 URL 中看到的,除 app.js 之外的所有其他文件均未包含在 index.html 文件中。毫无疑问,如果不包含路线,它不会找到 #/users/。
标签: javascript jquery ember.js