1

我想扩展routeProvider并实现附加参数(如templateUrl)。然后每次触发任何路由时,我都想调用一个函数,其作用域是routeProvider.

$routeProvider
.when("/Index",
{
    templateUrl:"./Views/index.html",
    controller:"IndexCtrl",
    myParam: "./Content/Text/file.json"
})
.always(function (myParam) 
{
    do something for any view with myParam parameter...
}

这个问题背后的背景就在这里。我将不胜感激。

4

0 回答 0