AngularJS获得当前templateUrl(HTML页面) [英] AngularJS get current templateUrl (html page)

查看:181
本文介绍了AngularJS获得当前templateUrl(HTML页面)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用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

这篇关于AngularJS获得当前templateUrl(HTML页面)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆