Commit bf029587 authored by Robert Knight's avatar Robert Knight

Tidy up app route initialization in app.js

Tidy up the 'resolve' object to use `// @ngInject` and add a comment to
clarify what it is for.
parent bc6b650e
......@@ -28,16 +28,20 @@ if (settings.raven) {
var mail = require('./vendor/jwz');
var streamer = require('./streamer');
var resolve =
// Ensure that we have available a) the current authenticated userid, and b)
// the list of user groups.
{
sessionState: ['session', function (session) { return session.load(); }],
store: ['store', function (store) { return store.$promise; }],
// Fetch external state that the app needs before it can run. This includes the
// authenticated user state, the API endpoint URLs and WebSocket connection.
var resolve = {
// @ngInject
sessionState: function (session) {
return session.load();
},
// @ngInject
store: function (store) {
return store.$promise;
},
streamer: streamer.connect,
threading: [
'annotationMapper', 'drafts', 'threading',
function (annotationMapper, drafts, threading) {
// @ngInject
threading: function (annotationMapper, drafts, threading) {
// Unload all the annotations
annotationMapper.unloadAnnotations(threading.annotationList());
......@@ -49,9 +53,8 @@ var resolve =
threading.thread(drafts.unsaved());
return threading;
}
]
};
},
};
// @ngInject
function configureLocation($locationProvider) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment