I will some time to look into all these example. Here is what I have so far:
app.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state('first', {
params:['partialURL', 'controller'],
views: {
upper: {
templateUrl: 'app/views/eventDetailFilters.html',
controller: 'eventDetailFiltersController'
},
lower: {
templateUrl: function ($stateParams){
return 'app/views/' + $stateParams.partialURL + '.html';
},
controller : function ($stateParams) {
return $stateParams.controller;
},
}
}
})
});
<body>
<ul>
<li><a>Home</a></li>
<li><a>Asset Status</a></li>
<li><a>Alarms</a></li>
<li><a>Annunciator panel</a></li>
<li><a>Reports</a>
<ul>
<li><div><a ng-click="go('first', 'eventDetailFields', 'eventDetailFieldsService')">Reports</a><div></li>
</ul>
</li>
</ul>
<div style="height:8px">
</div>
<div ui-view="upper"></div>
<div style="height:8px">
</div>
<div ui-view="lower"></div>
</body>
app.controller('eventDetailStateController', function($scope, $state) {
$scope.go = function (first, partialURL, controller) {
$state.go(first, { partialURL : partialURL, controller : controller });
}
});
When a menu is clicked, two views will be shown. Then when I click on a button on the upper view:
<button style="border-radius:5px" align="center" ng-click="runRefreshReport()">Generate Report</button>
it will go into a controller and run this:
$scope.go('lower@first', 'eventDetailReport', 'eventDetailReportController');
but nothing happens. Is there a way of making this working? Or it's not a way at all?
Thanks