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,我一定是做错了什么,因为这些{{link to}}失败了。这是一个JSBin。犹豫是否提交问题,因为这看起来很简单: 您的路线不允许参数。换成 App = Ember.Application.create({}); App.ApplicationRoute = Ember.Route.extend({ model: function(){ return [ {firstName: 'Kris', lastName: 'Selden'},

我一定是做错了什么,因为这些{{link to}}失败了。这是一个JSBin。犹豫是否提交问题,因为这看起来很简单:


您的路线不允许参数。换成

App = Ember.Application.create({});

App.ApplicationRoute = Ember.Route.extend({
  model: function(){
      return [
          {firstName: 'Kris', lastName: 'Selden'},
          {firstName: 'Luke', lastName: 'Melia'},
          {firstName: 'Formerly Alex', lastName: 'Matchneer'}
      ];
  }
});

App.Router.map(function() {
  this.route('foo');
});

App.FooRoute = Ember.Route.extend({
  model: function(params) {
    // just ignore the params
    return Ember.Object.create({
      name: 'something'
    });
  }
});

App.FooController = Ember.ObjectController.extend({
  fullName: function() {
    return this.get('name') + ' Jr.';
  }
});

我刚刚发现这是我的JSBin中的问题,但在我的实际应用程序中,我必须通过将每个问题包装在{{if length}}块中来解决问题。我还不确定是否可以复制,因为我们正在使用一些非常旧的对象代理模式,我现在正试图删除这些模式。
App = Ember.Application.create({});

App.ApplicationRoute = Ember.Route.extend({
  model: function(){
      return [
          {firstName: 'Kris', lastName: 'Selden'},
          {firstName: 'Luke', lastName: 'Melia'},
          {firstName: 'Formerly Alex', lastName: 'Matchneer'}
      ];
  }
});

App.Router.map(function() {
  this.route('foo');
});

App.FooRoute = Ember.Route.extend({
  model: function(params) {
    // just ignore the params
    return Ember.Object.create({
      name: 'something'
    });
  }
});

App.FooController = Ember.ObjectController.extend({
  fullName: function() {
    return this.get('name') + ' Jr.';
  }
});
this.resource('foo', { path: '/:person_id'});