In my app, main template has a drop-down list of months (Jan, Feb ...).
The main template contains an ng-view, loaded with partial templates using routeProvider.
How do I refresh the ng-view (by re-running its controller) from main template's controller?
So that partial template content will refresh when user switches to a different month.
Main template HTML:
....
<body class="" ng-controller="Main">
<div ng-view></div>
</body>
Route provider:
....
.config([ '$routeProvider', function($route) {
$route.when('/module/:module', {
templateUrl : 'partial/module.html',
controller : Module
}).otherwise({
templateUrl : 'partial/dashboard.html',
controller : Dashboard
});
} ]);
Main controller:
function Main($scope, $cookies) {
...switch month and ajax...
// Reload ng-view goes here
}