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) { ...@@ -28,16 +28,20 @@ if (settings.raven) {
var mail = require('./vendor/jwz'); var mail = require('./vendor/jwz');
var streamer = require('./streamer'); var streamer = require('./streamer');
var resolve = // Fetch external state that the app needs before it can run. This includes the
// Ensure that we have available a) the current authenticated userid, and b) // authenticated user state, the API endpoint URLs and WebSocket connection.
// the list of user groups. var resolve = {
{ // @ngInject
sessionState: ['session', function (session) { return session.load(); }], sessionState: function (session) {
store: ['store', function (store) { return store.$promise; }], return session.load();
},
// @ngInject
store: function (store) {
return store.$promise;
},
streamer: streamer.connect, streamer: streamer.connect,
threading: [ // @ngInject
'annotationMapper', 'drafts', 'threading', threading: function (annotationMapper, drafts, threading) {
function (annotationMapper, drafts, threading) {
// Unload all the annotations // Unload all the annotations
annotationMapper.unloadAnnotations(threading.annotationList()); annotationMapper.unloadAnnotations(threading.annotationList());
...@@ -49,9 +53,8 @@ var resolve = ...@@ -49,9 +53,8 @@ var resolve =
threading.thread(drafts.unsaved()); threading.thread(drafts.unsaved());
return threading; return threading;
} },
] };
};
// @ngInject // @ngInject
function configureLocation($locationProvider) { 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