$urlRouterProvider in nested modules and seperate router


#1

So I have a multimodule project in ionic, each projects containing its own $stateProvider and states.

When it comes to navigating between each projects, the wrapping project contains a navigation menu, which will route to “#/project1” for example. In this case, I want the module to navigate to #/project1/index.

I know I could define this all inside the wrapping module, but I want each submodule to handle this by itself. How am i supposed to use $urlRouterProvider assuming I have a seperate router.js in each module?

For example

var verzeichnisRouter = angular.module('verzeichnisRouter', ['ionic']);

verzeichnisRouter.config(function($stateProvider, $urlRouterProvider){

    $stateProvider
    .state('verzeichnis', {
        url: '/verzeichnis',
        abstract: true,
        templateUrl: 'pages/verzeichnis/index.html'
    })
    .state('verzeichnis.kneipen', {
        url: '/kneipen',
        views: {
            'kneipen-tab': {
                templateUrl: 'pages/verzeichnis/kneipen.html'               
            }
        }
    })
    .state('verzeichnis.favoriten', {
        url: '/favoriten',
        views: {
            'favoriten-tab': {
                templateUrl: 'pages/verzeichnis/favoriten.html' 
            }
        }
    })
    .state('verzeichnis.historie', {
        url: '/historie',
        views: {
            'historie-tab': {
                templateUrl: 'pages/verzeichnis/historie.html'
            }
        }
    });
});