【发布时间】:2017-09-21 10:31:39
【问题描述】:
我想更改状态Provider中的pageTitle里面的数据。
$stateProvider.state(test, {
url: '/test',
views: {
main: {
controller: 'TestCtrl',
templateUrl: 'admin/test.tpl.html'
}
},
data: {
pageTitle: 'Need some dynamic title',
},
});
这里我想动态设置页面标题可能在$state.go()里面的某个地方。
我尝试过使用
//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');
但是什么都没发生。 请帮忙。
【问题讨论】:
标签: javascript angularjs angular-ui-router state