forked from alexbeletsky/backbone-express-spa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrouter.js
36 lines (29 loc) · 776 Bytes
/
router.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
define(function(require) {
var Backbone = require('Backbone');
var viewManager = require('./viewManager');
var Router = Backbone.Router.extend({
routes: {
'': 'home',
'inbox': 'inbox',
'inbox/compose': 'inboxCompose',
'contacts': 'contacts',
'tasks': 'tasks'
},
home: function () {
require('./../apps/home/app').run(viewManager);
},
inbox: function () {
require('./../apps/inbox/app').run(viewManager);
},
inboxCompose: function () {
require('./../apps/inbox/subapps/compose/app').run(viewManager);
},
contacts: function () {
require('./../apps/contacts/app').run(viewManager);
},
tasks: function () {
require('./../apps/tasks/app').run(viewManager);
}
});
return Router;
});