使用
angularjs和ui-router我可以:
A.)定义我的状态时定义自定义变量(参见下面的“数据”).我目前这样做是成功的,想要确保它正确.
.state('parent',{url:'/parent',templateUrl: 'views/parent.html',abstract: true,data: {stuff: 'stuff'}})
B.)让我的孩子继承可变数据(How?)
.state('parent.child',{url:'/child',templateUrl: 'views/parent.child.html',data: parent.data})
?
解决方法
您没有将“数据”指定为子状态,已经从父/抽象状态继承.
您可以通过以下方式访
您可以通过以下方式访
$state.current.data