I'm pretty new with angular and I've read a lot of threads here and googled this topic but I cannot get a clear answer. What I'm trying to do is pass a value that is not set until the user makes a selection, at which point my controller will make a call an asynchronous call and assign the result to a value in the controller. My directive's controller needs to access this value to conduct its logic.
Here is some similar code to what I have.
app.controller('testCtrl', function($scope){
$scope.getData = function(){
//getDataFunc is a method in a Factory, which is not shown here
$scope.results = getDataFunc();
}
}
app.directive('testDir', function(){
return{
restrict: 'AE',
scope: {
resultData: '='
},
controller:['$scope', function($scope){
//I need to be able to access the $scope.results from the parent controller
}
}
}
Any help would be appreciated.