Thank u very much, i’m such a fan of 90% of ember, the problem is just that 10% that I totally dont understand.
I’ve multiple Projects with very similar use cases.
One thing, is that directly after the user has logged in, he needs to select a location where he’s working, and from that moment I need the authentication token and and that location always when I call the backend.
Additionally I dont use a model framework, because ember-data is not stable and my backend is fully not standard, so I need a lot of code to get my models, often with multiple ajax calls. So I use normal subclasses of Object as models, with a common base class with a few little helper methods, and then use
reopenClass to define the fetch functions.
Now I i try to find an elegant way to access the auth token and the location inside the fetch functions and the model instances, when I resolve some computed propertys with ajax calls.
For the fetch functions I can give the informations down from the route or controller, but I’ve no Idea for the computed properties. It seems very ugly to store both on every single model instance!
Currently I store everything directly on the App, but this seems just to be very ugly!
And, thats just one example, I’ve another Project with much more that
globallike data, but its always the same, first select that, and then I need it for every ajax call.