angularjs ui-router父状态
发布时间:2020-12-17 17:37:36 所属栏目:安全 来源:网络整理
导读:使用 angularjs和ui-router我可以: A.)定义我的状态时定义自定义变量(参见下面的“数据”).我目前这样做是成功的,想要确保它正确. .state('parent',{url:'/parent',templateUrl: 'views/parent.html',abstract: true,data: {stuff: 'stuff'}}) B.)让我的孩
使用
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 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |