Multiple viewports with child routers

Hi

Is it possible to have multiple viewports, while each of them have their own child routers? I created a gist to demonstrate my problem:

Please check the following route in app.ts:

config.mapRoute({
	route: 'home',
	name: 'home',
	viewPorts: {
	  'feature1': {
		moduleId: PLATFORM.moduleName('./feature1/index')
	  },
	  // WHEN YOU COMMENT OUT THE SECOND VIEWPORT, THE ROUTING IS WORKING!!
	  'feature2': {
		moduleId: PLATFORM.moduleName('./feature2/index')
	  }
	}
});

The edit links are not working, but as soon as you comment out the second viewport, it is working again. Should it be possible to have multiple viewports while they all have their own child router? Thanks for any help.

1 Like

This isn’t really helpful for your current need, but it might be nice to know that in v2 this is fairly easy to achieve. One example, without even a single line of javascript, can be found here: https://gist.dumber.app/?gist=e516d7e533657e693f1653f429447745.

2 Likes

I’m not sure if I can leverage this to the max yet, but it’s amazing at a glance! :smiley: