You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I want to have MyModel to be under a namespace, say cr.app.music.data.MyModel, that won't work. There are certain places in the FOAM code that is hostile to namespace scopes. For example, mm5Misc.js:140
The GLOBAL does have the relatedModel (cr.app.music.data.MyModel), but JavaScript won't allow one to access that thing as GLOBAL['cr.app.music.data.MyModel']. It accepts either cr.app.music.data.MyModel, or GLOBAL['cr']['app']['music']['data']['MyModel'].
We will be getting rid of all globals. The plan is for all Models to explicitly declare their dependencies, which will then be satisfied by the inversion-of-control system, rather than letting objects access their dependencies explicitly from the global namespace.
From arthur...@google.com on October 22, 2013 15:00:27
Currently all models must be defined as global scope, e.g.
Model.create({
model_: 'Model',
name: 'MyModel',
...
});
If I want to have MyModel to be under a namespace, say cr.app.music.data.MyModel, that won't work. There are certain places in the FOAM code that is hostile to namespace scopes. For example, mm5Misc.js:140
defaultValueFn: function() { return GLOBAL[this.relatedModel].plural; }
The GLOBAL does have the relatedModel (cr.app.music.data.MyModel), but JavaScript won't allow one to access that thing as GLOBAL['cr.app.music.data.MyModel']. It accepts either cr.app.music.data.MyModel, or GLOBAL['cr']['app']['music']['data']['MyModel'].
Original issue: http://code.google.com/p/foam-framework/issues/detail?id=29
The text was updated successfully, but these errors were encountered: