I am currently using the directive found in this question to change the page names.
Set page title using UI router
Then, in my app.js file, I add pageTitle to the data, for example:
.state('home', { url: '/home' templateUrl: 'home.html' controller: 'homeController' data: { pageTitle: 'Home' } })
But let's say, for example, if homeController has the $scope.todaysDate variable retrieved from the service. Is there a way to access this variable in my router, so I can change the data and pageTitle to something like:
data: { pageTitle: 'Home ' + $scope.todaysDate }
I can log in to the controller and use $rootScope.pageTitle = 'some value' , I see that it changes the variable to 'some value' when I look in the Batarang console tool, but the actual page name does not change.
twinb source share