0

ユーザーは、メイン ルーターによって以下の App.IndexRoute に正しくルーティングされています。

App.IndexRoute = Ember.Route.extend({
 model: function() {
    return App.Contact.find();
  },
  init: function() {console.log('were in the indexroute! ive been created.')},
  controller: 'index',

  setupController: function(controller) {
        controller.set('content', App.Contact.find());
        console.log('the IndexController is set up, with the model equal to ' + controller.get('content') + '.');
    },


  renderTemplate: function() {
    this._super();
      this.render('contacts', {
        outlet: 'sidebar',
        into:'index',
        controller: 'contacts'
      });
      this.render('map', {
        into: 'index',
        outlet: 'map', //cannot connect outlet yet, acc. GitHub ember-data gist #1838
        controller: 'map'
      });
    }
});

しかし、インデックス ページは、Handlebars で定義された動的コンテンツの読み込みを拒否します。this._super()関数から削除renderTemplateすると、「connectOutlet」が定義されていないタイプ エラーが発生します。インデックス ページ (もちろん非表示) のハンドルバー テンプレートでコメントを取得しているので、それらが正しく読み込まれていることがわかります。

誰でもルート定義の問題を見つけることができますか? そうでない場合は、さらに掘り下げる必要があります。アドバイスをいただければ幸いです。

注: Ember、Ruby、Rails などはすべて執筆時点で最新のものです。Chrome コンソール デバッガーは次のように表示します。

DEBUG: Ember.VERSION : 1.0.0-rc.1 ember.js:348
DEBUG: Handlebars.VERSION : 1.0.0-rc.3 ember.js:348
DEBUG: jQuery.VERSION : 1.9.1 
4

0 に答える 0