Multiple routers files for an Ember app



I am working on modular application ,in the core module,ember folder exists base on structural of ember cli ,so the “router.js” file is available. with this code :

import Ember from ‘ember’;

import config from ‘./config/environment’;

const Router = Ember.Router.extend({ location: config.locationType }); { });

export default Router;

but I want, when other modules is added to Core module in runtime, each module is inject own separate routes


I don’t know how to do it on runtime but you can import routes like this:

import adminRouter from 'ember-admin/router'; {



Thanks for the answer.

But My question is : Splitting routes into multiple files in a large application.In each module, a router file exists. but this path is not detected.

when writing program by es5, there is a global variable in core module. for example

window.Arad = Ember.Application.create({});

the global variable is Arad .

in other modules, by this global variable ,each module adds its routes to ember app with the following code () {

this.route("testInvitationModule", function () {
    this.route('invitation', function () {
        this.route("about", function () {


But I do not know how to do this in es6 ?


Not sure I understand the question but if you use ember-cli you can write something like this:


Perhaps my question is:

How to call or load Multiple routers files for an ember app, then after call or load Multiple routers files, all Routers to be added to the ember app ?


How to add dynamic routing in ember app ?


dependncy injection for inject router to ember app ?


It’s not supported in Ember yet, but the core team is actively working on it in this addon:


thanks for your answer