现在我像这样启动一个 angularjs(version:1.0.8) 应用程序:
angular.module('cms', ['angularFileUpload','ui.bootstrap']).
config(['$routeProvider','$httpProvider', function($routeProvider,$httpProvider) {
//$httpProvider.defaults.withCredentials = true;
$routeProvider.
when('/foo',{templateUrl: 'partials/foo/index.html',resolve:{nav:function(){
renderNav();
}}}).
.when('/bar',{templateUrl: 'partials/bar/index.html',resolve:{nav:function(){
renderNav();
}}})
}]);
每次更改路线时,我都想调用函数 renderNav(),那么如何使用 $routeProvider 来实现呢?