我用AngularJS构建我的应用程序。 NG-视图
设置经由routeProvider路由。
I've used AngularJS to build my app. ng-view
is set up with routing via the routeProvider.
这一切工作正常,但我想知道我怎么能得到当前templateUrl?
It all works fine but I'd like to know how I can get the current templateUrl?
$routeProvider.
when('/terms', {
templateUrl: '/pages/terms.html',
controller: AboutController
});
在这种情况下, /pages/terms.html
...
In this case /pages/terms.html
...
您可能正在寻找 $ route.current.templateUrl
。