Navin Chinnasamy Navin Chinnasamy - 1 month ago 6x
AngularJS Question

Get angularjs controller of current html page

How can I get the controller of the current page that is displayed on device? I just want to add a class named as controller name of that page. So that I can customize that page dynamically.


Do like this :$rootScope) {
    $rootScope.$on('$routeChangeSuccess', function(ev,data) {   
       if (data.$route && data.$route.controller)
    $rootScope.controller = data.$route.controller;