I use the same controller for multiple views. I want to parameterize the controller differently depending on the route taken.
The views display basically the same angular ui grid, hence the same controller. However, in one view I want to pre-filter the grid for specific data, whereas in the other I don't.
How can I do that?
app.config(function ($routeProvider) {
$routeProvider
.when('/foo',
{
controller: 'Ctrl',
templateUrl: '/foo.html',
})
.when('/bar',
{
controller: 'Ctrl',
templateUrl: '/bar.html',
});
});
app.controller('Ctrl', ['$scope' function ($scope) { .. }]);