Ember.js 无法通过转换重定向到嵌套资源路由

Ember.js 无法通过转换重定向到嵌套资源路由,ember.js,Ember.js,更新:我升级到rc3,问题仍然存在。我发现第二次点击链接成功 Ember.js v1.0.0-rc.3 具有嵌套资源的我的路由器,用于上下文: App.Router.map(function(match) { this.resource('items', function() { this.resource('item', { path: ':item_id' }, function() { this.resource('images', func

更新:我升级到rc3,问题仍然存在。我发现第二次点击链接成功

Ember.js v1.0.0-rc.3

具有嵌套资源的我的路由器,用于上下文:

App.Router.map(function(match) {
    this.resource('items', function() {
        this.resource('item', { path: ':item_id' }, function() {
            this.resource('images', function() {
                this.resource('image', { path: ':image_id' });
            });
        });
    });
});
我希望“/items”重定向到第一项:“/items/1”

App.ItemsRoute = Em.Route.extend({
    model: function() {
        return App.Item.find({});
    },
    redirect: function() {
        var item = this.modelFor('items').get('firstObject');
        this.transitionTo('item', item);
    }
});
问题:用以下方法命中/删除项目错误:

Error: assertion failed: Cannot call get with 'id' on an undefined object.
注意:My ItemIndexRoute也在重定向,以便在其出口中显示第一个图像:

App.ItemIndexRoute = Em.Route.extend({
    model: function(params) {
        return App.Item.find(params.item_id);
    },
    redirect: function(params) {
        var image = App.Image.find(params.item_id).get('firstObject');
        this.transitionTo('images');
    }
});
如果删除ItemIndexRoute上的重定向,则在/items处会得到以下内容:

警告:直接父路由('a')未进入主出口,可能不需要默认的“进入”选项('p') ember.js:349已转换为“items.item.index”