I want to change the pageTitle inside data in state Provider.
$stateProvider.state(test, {
  url: '/test',
  views: {
    main: {
      controller: 'TestCtrl',
      templateUrl: 'admin/test.tpl.html'
    }
  },
  data: {
    pageTitle: 'Need some dynamic title',                        
  },                    
});
Here I want to set the page title dynamically may be somewhere inside $state.go().
I tried using
//The controller from where the state is called and we got to know what the title is
$state.get('test').data.pageTitle = $scope.title;
$state.go('test');  
But nothing has happened. Please help.
 
    