I'm trying to implement a site with two main content 'panes' (imagine two columns each half the width of the page). The panes should be able to change independent of each other and have their own controllers and be able to pass data between each other (so the user can navigate through a bunch of pages on the left pane while the right pane stays the same without reloading and vice versa, and a change in the left pane can update data showing up in the right pane).
I've looked through a bunch of examples/tutorials on UI Router but can't seem to find a good example of how to implement what I'm trying to do. All of them seem to show either just examples for single nested views (so a single view within a larger view) or show multiple views but not how to change the views independent of each other.
I'd like to do this with a single <div ui-view></div> in the index.html file (as opposed to multiple ui-views) so that I can have everything happening within the single parent ui-view and not in the index.html file.
Right now I have something like the following js file:
config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/home');
$stateProvider
.state('home', {
url: '/home',
views: {
'': { templateUrl: 'views/home.html' },
'left@home': {
templateUrl: 'views/charting/chartHome.html',
},
'right@home': {
templateUrl: 'views/view1.html',
controller: 'View1Ctrl'
}
}
});
}]);
and the following HTML for home.html:
<div>
<h1>This is home</h1>
</div>
<div ui-view='left'>
</div>
<div ui-view='right'>
</div>
Can anyone help with this? Or is this the wrong way to be thinking about the site? If so what should I be doing?
Thanks!