emberjs itemController

イシュー

  • emberJsの itemControllerの仕組みについて

参考

itemControllerの使用どころ

  • itemControllerは、each のモデルに適用するコントローラ

duplication 情報

OBJECTCONTROLLER

Experienced Ember users have enjoyed the use of proxying behavior in the Ember.ObjectController class since 1.0. However, this behavior will be removed in Ember 2.0 as the framework migrates to routable components. New users hit three roadbumps when learning about the object controller pattern. Given a certain model, which of the three controller options should I be using? Which controller is generated by the framework if I do not specify one? When using an object controller, why should the this context not be passed to actions if it has the properties of my model? For these reasons, the Road to Ember 2.0 RFC listed object controllers as a concept to be removed from the framework. To migrate from an explicitly defined object controller, first convert the class definition to inherit from Ember.Controller. For example:

  • オブジェクトコントローラ
  • 経験豊富なEmberのユーザーは1.0以降のEmber.ObjectControllerクラスのプロキシの動作を使用することを楽しんできました。しかしながらフレームワークは、ルーティング可能なコンポーネントに移行し、この動作はエンバー2.0で削除されます。
  • 新規ユーザーはオブジェクトコントローラのパターンについて学ぶときに3つのつまづきポイントにぶつかります。
  • ある特定のモデルにおいて、3つのうちの1つとしては、コントローラのオプションを使用する必要があるかどうか?

  • もしコントローラを指定しなかった場合、フレームワークによってどのコントローラが生成されるか?

  • オブジェクトコントローラを使用する場合、もしモデルにプロパティを持っていたら、この内容はなぜアクションに渡されるべきではないか?

  • これらの理由から、Ember 2.0 のRFCリストロードマップにおいて、概念としてのオブジェクト·コントローラは、フレームワークから削除します。

  • 明示的に定義されたオブジェクトのコントローラから移行するには、最初のEmber.Controllerから継承するクラス定義に変換します。例えば:

  • Ember.js - Controllers: Representing a Single Model with ObjectController