Using Angular JS - UI Router, I need to communicate from my parent view project.details
to my child view project.details.tasks
. How can my child view access the scope of the parent view? Also I would like my parent view to be able to call functions on my child view? How can I do this?
This is a rough example of what I am trying to do:
.state('project.details', {
url: "/:id",
template: '<a ng-click="[target-route??]>childFunction()">',
controller: function($scope){
$scope.parentString = "parent value";
}
})
.state('project.details.tasks', {
url: "/tasks",
templateUrl: "project.details.tasks.html",
controller: function($scope){
console.log("how do I get" + $scope.parentString + " here?";
$scope.childFunction = function() { console.log('Parent calling');
}
})