app.config(['$routeProvider', "$locationProvider", function ($routeProvider) {
$routeProvider.when("/", {
templateUrl: 'home',
controller: "homeController"
}).when("/monitoring", {
templateUrl: 'monitoring',
controller: "monitoringController"
}).otherwise({
redirectTo: "/"
});
}])
上面的代码第一个路径是 “ / ” , 假设现在在满足某一个条件下,将路径 “ / ” 下面的 “templateUrl” 和 “controller” 修改为 “/index” 和 “indexController” 该如何做 ?
You can configure a new route (/index), then make a judgment in homeController, and jump to the /index route when the conditions are met.