Resolve is used to pass additional parameters to controller, for example:
$routeProvider
.when('/a', {
templateUrl: '/tmpl',
controller: 'myCtrl',
resolve: {
someParameter: function(){
return 'konichiva';
}
}
})
.when('/b', {
templateUrl: '/tmpl',
controller: 'myCtrl',
resolve: {
someParameter: function(){
return 'vatashiva';
}
}
});
in myCtrl
:
wikiApp.controller('myCtrl', function(someParameter){
// if path is "/a" then "konichiva" will be logged
// else if path is "/b" then "vatashiva" will be logged
console.log(someParameter);
});