アプリケーションの名前空間を宣言したとしましょう:
App = Ember.Application.create();
その後、オブジェクトを作成する arrayController インスタンスを作成し、それをユーザー イベントでアプリの名前空間にフックします。
App.objController = Ember.ArrayController.create({
content: [],
createObj: function(){
// instantiate new object
var newObj = Ember.Object.create({ ... })
//give obj a name
var newObjName = this._getObjName( someParam );
// hook object to an app namespace -> this is where I have an issue
App[newObjName] = newObj
},
...
});
App[newObjName] = newObj を明示的に使用して、オブジェクトを名前空間にフックします。理想的には、後で別のアプリケーションに objController を使用する場合に備えて、アプリケーションの名前空間に名前を付ける何らかの汎用的な方法が必要です。
私はEmberに遭遇するほど十分に精通していませんが、これを行うには何らかの方法が必要です.
注: JFGI の 1 段階評価では、この質問は絶対に 1 ではありません。