指向每个块内部的Ember.js链接不会渲染
我一定是做错了什么,因为这些{{link to}}失败了。这是一个JSBin。犹豫是否提交问题,因为这看起来很简单:指向每个块内部的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'},
您的路线不允许参数。换成
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'});