Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS get current templateUrl (html page)

I've used AngularJS to build my app. ng-view is set up with routing via the routeProvider.

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
                   });

In this case /pages/terms.html...

like image 879
Greg Avatar asked Nov 10 '12 23:11

Greg


1 Answers

You're probably looking for $route.current.templateUrl.

like image 94
Ilya O. Avatar answered Nov 10 '22 12:11

Ilya O.