I'm currently using the directive found in this question to change my page titles.
Set Page title using UI-Router
Then, in my app.js file, I append the pageTitle to data, like so:
.state('home', {
url: '/home'
templateUrl: 'home.html'
controller: 'homeController'
data: {
pageTitle: 'Home'
}
})
But say, for instance, if homeController had a $scope.todaysDate
variable that was fetched from a service. Is there a way to access that variable in my router, so I can change data and pageTitle to something like:
data: {
pageTitle: 'Home ' + $scope.todaysDate
}
I'm able to go into the controller and using $rootScope.pageTitle = 'some value'
I can see it changes the variable to 'some value'
when I look in the Batarang console tool, but the actual page title doesn't change.