I have the following format where I have a global component that has 3 nested components that are activated based on a given route:
$stateProvider
.state('create-goal', {
url: '/create-goal',
component: 'createGoal',
redirectTo: 'create-goal.step-1'
})
.state('create-goal.step-1', {
url: '/step-1',
component: 'step1'
})
.state('create-goal.step-2', {
url: '/step-2',
component: 'step2'
})
.state('create-goal.step-3', {
url: '/step-3',
component: 'step3'
});
Inside of the main create-goal
html file, I have the following:
<ui-view goal="$ctrl.goal"
goalInfo="$ctrl.goalInfo"
processStep1="$ctrl.processStep1">
</ui-view>
The goal
and goalInfo
work great as they are data that is one way data bound. However, when I want to pass down a function, such as processStep1
to compute some action on step-1
and so forth, that function does not show up in the step-1
component even though the goal
and goalInfo
do.
export default {
name: 'step1',
restrict: 'E',
bindings: {
goal: '<',
processStep1: '&'
},
template,
controller
};
Thoughts?