Multiple applications sharing a Router

20 views
Skip to first unread message

Sophia Raw

unread,
Nov 13, 2014, 8:31:21 AM11/13/14
to backbone-...@googlegroups.com
Hi All

I really need some help with routing.

I am using multiple applications in my project. 
I have a base App -> BaseApp

And then as I need the other sections I start those apps:
FinanceApp
ManagementApp
SalesApp


So every time I need to start an app I do this:
$(document).ready(function () {

            FinanceApp.runtime.category = JSON.parse('<%= category as JSON %>');
            FinanceApp.runtime.projectId = '<%= projectId %>';
            FinanceApp.runtime.clientId = '<%= clientId %>';
            BaseApp.runtime.flash = '<%= flashMap %>';
            BaseApp.runtime.currencySymbol = '<%= currencySymbol %>';

            FinanceApp.addRegions({
                headerRegion: "#bm-finance-header",
                messageRegion: "#bm-flash-message",
                dataRegion: "#bm-category-items-region",
                dialogRegion: "#bm_dialog_region"
            });

            FinanceApp.addInitializer(function (options) {
                FinanceApp.module("FinanceModule").start();
            });

            if(BaseApp.runtime.started == false) {
                BaseApp.start();
            }
            FinanceApp.start();
        });

I have my Router in by BaseApp, when starting only the FinanceApp, my router works just fine, but as soon as I start the SalesApp or ManagementApp on the same page, my router does not work for them.

Please can you assist me on how to setup a Router for multiple apps.

Joanne Daudier

unread,
Nov 13, 2014, 10:24:17 AM11/13/14
to backbone-...@googlegroups.com
Sophia: Come on Gitter and ask your question.  You'll get answers faster: 
Reply all
Reply to author
Forward
0 new messages