In the Aurelia documentation on ViewPorts, the use an example that would imply a screen in which you have a list of items on the left and the detail of a selected item on the right.
config.map([
{ route: 'users', name: 'users', viewPorts: { left: { moduleId: 'user/list' }, right: { moduleId: 'user/detail' } } }
]);
In my mind, the VM for each ViewPort would have its own model. The left
VM would have a users
array and the right
VM might have a user
. However, if the user of the application selected a different user from the list, the detail would need to update.
I’m curious how this works with multi-viewports. Do you have to use events and the eventaggregator to communicate between the two viewports and VMs or is there some other means of accomplishing this?