Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ember.js 没有资源“发布”余烬应用程序_Ember.js - Fatal编程技术网

Ember.js 没有资源“发布”余烬应用程序

Ember.js 没有资源“发布”余烬应用程序,ember.js,Ember.js,我正在从主干网转移到余烬,并开始尝试制作一个博客应用程序 我得到了错误- 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 = f

我正在从主干网转移到余烬,并开始尝试制作一个博客应用程序

我得到了错误-

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')
});
映射是一个函数,而不是您设置的属性

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