没有资源'帖子' Ember App

时间:2014-04-30 23:00:04

标签: ember.js

我从Backbone转移到Ember,并开始尝试制作博客应用程序。

我收到了错误 -

Uncaught Error: Assertion Failed: The attempt to link-to route 'posts' failed. The router did not find 'posts' in its possible routes: 'loading', 'error', 'index', 'application' 

这是我到目前为止 -

Blog.Router.map = function() {
  this.resource('posts');
}

Blog.PostsRoute = Ember.Route.extend({
  model: function() {
    this.get('store').findAll('post')
  }
})

Blog.Post = DS.Model.extend({
  name: DS.attr('string')
});

1 个答案:

答案 0 :(得分:0)

map是一个函数,而不是您设置的属性。

Blog.Router.map( function() {
  this.resource('posts');
});