I have two different controller where i am trying to pass variable values to do some actions, I used $broadcast
angularJS event but its not working. Is there any other solution to achieve this task ?
I understand there is already question asked regarding variables between controller but i wanted to know what are other possible soultions.
ctrl1.js
$scope.viewAssessmentFrmCycle = function(assessmentId) {
$scope.$broadcast('viewAssessment',assessmentId);
}
ctrl2.js
$scope.$on('viewAssessment',function(s,assessmentId){
console.log(assessmentId);
$location.path('/rcsa/editAssessmentFromCycle/'+assessmentId+);
});