I want to create multiple apps within one app that will be hosted on the same server.
I am using the following link as a guide but I am unsure how to implement some of it: Muliple spas
I have the app setup as follows:
src/
bower_components
apps/
app1/
app.js
index.html
app2/
app.js
index.html
Each index page has its own ng-app. I am using grunt-contrib-connect to serve the application for development. I have a middleware setup to default to app1:
middleware: function (connect, options, middlewares) {
var modRewrite = require('connect-modrewrite');
middlewares.unshift(modRewrite(['!\\.html|\\.js|\\.ts|\\.ttf|\\.woff|\\.eot|\\.svg|\\.css|\\.png$ /apps/app1/index.html [L]']));
return middlewares;
}
When I run the application app1 works as expected, but I am unsure how to navigate to app2 and have it bootstrap.
If I change the middleware to default to app2 it also works as expected so both apps run fine on their own.
How can i move to app2 and have it bootstrap? Do I need to map it someway in grunt-contrib-connect?
I have tried simply navigating to app2 using a href and $window.location.href but to no avail.