I am banging my head with this. My controller structure is appController at the top, then a mapController. all other controllers are nested and are parallel of each other. they are being instantiated with the ui-router ui-view state change.
In my map controller I have this inside a function
$scope.$broadcast('selectedIdsForExport', selectedIds);
this works. the $on function is inside a chartController that has just been instantiated with a state change.
$scope.$on('selectedIdsForExport', function (event, selectedIds) {
this is being hit from the broadcast. but it does not enter the function.it skips over it.this is where i am lost. I do have this $on function inside a $watch function, I thought that could be a issue but if it was a issue the $on function would not be hit? Am I wrong about that?
how can i trouble shoot this?
note that inside my mapController I have 2 functions that both have the same $broadcast function. This should not be a issue? also I two chartControllers that have the same $on function. But if that was a issue the breakpoint would not catch on the $on function that I am trying to enter. is that correct?
here is a couple of screenshots that might help. on my page load/refresh this is the pattern. this works correctly
when I click on the tab to switch charts, this is the pattern.
this is where it skips over the $on function