Using angularjs and ui-router can I:
A.) Define custom variables when defining my state (see 'data' below). I currently do this with success, wanted to make sure its proper.
.state('parent', {url:'/parent', templateUrl: 'views/parent.html', abstract: true, data: {stuff: 'stuff'}})
B.) Have my child state inherit that variable data ( How? )
.state('parent.child', {url:'/child', templateUrl: 'views/parent.child.html', data: parent.data})
?
You don't specify "data" into the child state, is already inherited from parent/abstracted state. You access it by :
$state.current.data
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With